From 4ea4d32554b6dfd6007845bfd41d73dbcdc21776 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 27 Sep 2012 23:50:15 +0000 Subject: [PATCH] merge active_tracker_limit increase and logging polish from RC_0_16 --- ChangeLog | 1 + src/session.cpp | 2 +- src/session_impl.cpp | 4 ++-- src/torrent.cpp | 26 ++++++++++++++++++-------- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1a09df83..09c4e9921 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * raise the default number of torrents allowed to announce to trackers to 1600 * improve uTP slow start behavior * fixed UDP socket error causing it to fail on Win7 * update use of boost.system to not use deprecated functions diff --git a/src/session.cpp b/src/session.cpp index 3c579c14d..fa1d34c5b 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -1170,7 +1170,7 @@ namespace libtorrent , active_downloads(3) , active_seeds(5) , active_dht_limit(88) // don't announce more than once every 40 seconds - , active_tracker_limit(360) // don't announce to trackers more than once every 5 seconds + , active_tracker_limit(1600) // don't announce to trackers more than once every 1.125 seconds , active_lsd_limit(60) // don't announce to local network more than once every 5 seconds , active_limit(15) , auto_manage_prefer_seeds(false) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 954efecab..b7263343d 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -4090,14 +4090,14 @@ namespace aux { --hard_limit; --type_limit; #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING - t->log_to_all_peers(("AUTO MANAGER STARTING TORRENT: " + t->torrent_file().name()).c_str()); + t->log_to_all_peers("AUTO MANAGER STARTING TORRENT"); #endif t->set_allow_peers(true); } else { #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING - t->log_to_all_peers(("AUTO MANAGER PAUSING TORRENT: " + t->torrent_file().name()).c_str()); + t->log_to_all_peers("AUTO MANAGER PAUSING TORRENT"); #endif // use graceful pause for auto-managed torrents t->set_allow_peers(false, true); diff --git a/src/torrent.cpp b/src/torrent.cpp index d53c4ca53..4a6df04dc 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -745,7 +745,6 @@ namespace libtorrent m_override_resume_data = true; init(); - start_announcing(); } #else @@ -856,7 +855,6 @@ namespace libtorrent m_override_resume_data = true; init(); - start_announcing(); } #endif @@ -1897,7 +1895,7 @@ namespace libtorrent } #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING else - debug_log("fastresume data rejected accepted"); + debug_log("fastresume data accepted"); #endif #endif @@ -2263,13 +2261,25 @@ namespace libtorrent TORRENT_ASSERT(m_ses.is_network_thread()); INVARIANT_CHECK; - if (m_trackers.empty()) return; + if (m_trackers.empty()) + { +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING + debug_log("*** announce_with_tracker: no trackers"); +#endif + return; + } if (m_abort) e = tracker_request::stopped; // if we're not announcing to trackers, only allow // stopping - if (e != tracker_request::stopped && !m_announce_to_trackers) return; + if (e != tracker_request::stopped && !m_announce_to_trackers) + { +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING + debug_log("*** announce_with_tracker: event != stopped && !m_announce_to_trackers"); +#endif + return; + } TORRENT_ASSERT(m_allow_peers || e == tracker_request::stopped); @@ -2413,7 +2423,7 @@ namespace libtorrent } } #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING - debug_log(" ==> TRACKER REQUEST \"%s\" event: %s abort: %d" + debug_log("==> TRACKER REQUEST \"%s\" event: %s abort: %d" , req.url.c_str() , (req.event==tracker_request::stopped?"stopped" :req.event==tracker_request::started?"started":"") @@ -7339,7 +7349,7 @@ namespace libtorrent TORRENT_ASSERT(m_ses.is_network_thread()); if (is_paused()) { -#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING debug_log("start_announcing(), paused"); #endif return; @@ -7349,7 +7359,7 @@ namespace libtorrent // request the metadata from if (!m_files_checked && valid_metadata()) { -#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING debug_log("start_announcing(), files not checked (with valid metadata)"); #endif return;