From 1bfa04eabc2c529ac9b73039086515d221ba9d7d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 21 Jan 2013 10:16:34 +0000 Subject: [PATCH] merged fix from RC_0_16 --- ChangeLog | 1 + src/torrent.cpp | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88ca6a285..d9ecae9f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * honor trackers responding with 410 * fixed merkle tree torrent creation bug * fixed crash with empty url-lists in torrent files * added missing max_connections() function to python bindings diff --git a/src/torrent.cpp b/src/torrent.cpp index 43aeac591..94f794846 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -8715,9 +8715,6 @@ namespace libtorrent return ret; } - // TODO: 3 with 110 as response codes, we should just consider - // the tracker as a failure and not retry - // it anymore void torrent::tracker_request_error(tracker_request const& r , int response_code, error_code const& ec, const std::string& msg , int retry_interval) @@ -8741,6 +8738,9 @@ namespace libtorrent #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING debug_log("*** increment tracker fail count [%d]", ae->fails); #endif + // never talk to this tracker again + if (response_code == 410) ae->fail_limit = 1; + deprioritize_tracker(tracker_index); } if (m_ses.m_alerts.should_post()) @@ -8751,6 +8751,13 @@ namespace libtorrent } else if (r.kind == tracker_request::scrape_request) { + if (response_code == 410) + { + // never talk to this tracker again + announce_entry* ae = find_tracker(r); + if (ae) ae->fail_limit = 1; + } + if (m_ses.m_alerts.should_post()) { m_ses.m_alerts.post_alert(scrape_failed_alert(get_handle(), r.url, ec));