merged fix from RC_0_16

This commit is contained in:
Arvid Norberg 2013-01-21 10:16:34 +00:00
parent b3ef6011aa
commit 1bfa04eabc
2 changed files with 11 additions and 3 deletions

View File

@ -10,6 +10,7 @@
* fix uTP edge case where udp socket buffer fills up * fix uTP edge case where udp socket buffer fills up
* fix nagle implementation in uTP * fix nagle implementation in uTP
* honor trackers responding with 410
* fixed merkle tree torrent creation bug * fixed merkle tree torrent creation bug
* fixed crash with empty url-lists in torrent files * fixed crash with empty url-lists in torrent files
* added missing max_connections() function to python bindings * added missing max_connections() function to python bindings

View File

@ -8715,9 +8715,6 @@ namespace libtorrent
return ret; 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 void torrent::tracker_request_error(tracker_request const& r
, int response_code, error_code const& ec, const std::string& msg , int response_code, error_code const& ec, const std::string& msg
, int retry_interval) , int retry_interval)
@ -8741,6 +8738,9 @@ namespace libtorrent
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
debug_log("*** increment tracker fail count [%d]", ae->fails); debug_log("*** increment tracker fail count [%d]", ae->fails);
#endif #endif
// never talk to this tracker again
if (response_code == 410) ae->fail_limit = 1;
deprioritize_tracker(tracker_index); deprioritize_tracker(tracker_index);
} }
if (m_ses.m_alerts.should_post<tracker_error_alert>()) if (m_ses.m_alerts.should_post<tracker_error_alert>())
@ -8751,6 +8751,13 @@ namespace libtorrent
} }
else if (r.kind == tracker_request::scrape_request) 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<scrape_failed_alert>()) if (m_ses.m_alerts.should_post<scrape_failed_alert>())
{ {
m_ses.m_alerts.post_alert(scrape_failed_alert(get_handle(), r.url, ec)); m_ses.m_alerts.post_alert(scrape_failed_alert(get_handle(), r.url, ec));