retry failed trackers a little bit sooner. make the exponential back-off not quite grow as fast

This commit is contained in:
Arvid Norberg
2012-03-24 15:15:36 +00:00
parent 6fcc469aef
commit 4d60adcaa9
5 changed files with 26 additions and 5 deletions

View File

@@ -386,8 +386,8 @@ namespace libtorrent
boost::shared_ptr<request_callback> cb = requester();
if (!cb) return;
int interval = int(e.dict_find_int_value("interval", 1800));
int min_interval = int(e.dict_find_int_value("min interval", 60));
int interval = int(e.dict_find_int_value("interval", 0));
int min_interval = int(e.dict_find_int_value("min interval", 30));
std::string trackerid;
lazy_entry const* tracker_id = e.dict_find_string("tracker id");
@@ -427,6 +427,10 @@ namespace libtorrent
, interval, min_interval);
return;
}
// if no interval is specified, default to 30 minutes
if (interval == 0) interval == 1800;
int complete = int(scrape_data->dict_find_int_value("complete", -1));
int incomplete = int(scrape_data->dict_find_int_value("incomplete", -1));
int downloaded = int(scrape_data->dict_find_int_value("downloaded", -1));