fixed bug where trackers wouldn't be retried if they failed
This commit is contained in:
parent
8d3733b013
commit
2705859bb4
|
@ -28,6 +28,7 @@
|
||||||
incoming connection
|
incoming connection
|
||||||
* added more detailed instrumentation of the disk I/O thread
|
* added more detailed instrumentation of the disk I/O thread
|
||||||
|
|
||||||
|
* fixed bug where trackers wouldn't be retried if they failed
|
||||||
* slight performance fix in disk elevator algorithm
|
* slight performance fix in disk elevator algorithm
|
||||||
* fixed potential issue where a piece could be checked twice
|
* fixed potential issue where a piece could be checked twice
|
||||||
* fixed build issue on windows related to GetCompressedSize()
|
* fixed build issue on windows related to GetCompressedSize()
|
||||||
|
|
|
@ -1432,7 +1432,7 @@ int main(int argc, char* argv[])
|
||||||
snprintf(str, sizeof(str), "%2d %-55s fails: %-3d %s %s \"%s\" %s\n"
|
snprintf(str, sizeof(str), "%2d %-55s fails: %-3d %s %s \"%s\" %s\n"
|
||||||
, i->tier, i->url.c_str(), i->fails, i->verified?"OK ":"- "
|
, i->tier, i->url.c_str(), i->fails, i->verified?"OK ":"- "
|
||||||
, i->updating?"updating"
|
, i->updating?"updating"
|
||||||
:!i->verified?""
|
:!i->will_announce(now)?""
|
||||||
:to_string(total_seconds(i->next_announce - now), 8).c_str()
|
:to_string(total_seconds(i->next_announce - now), 8).c_str()
|
||||||
, i->last_error ? i->last_error.message().c_str() : ""
|
, i->last_error ? i->last_error.message().c_str() : ""
|
||||||
, i->message.c_str());
|
, i->message.c_str());
|
||||||
|
|
|
@ -149,6 +149,13 @@ namespace libtorrent
|
||||||
|
|
||||||
void failed(int retry_interval = 0);
|
void failed(int retry_interval = 0);
|
||||||
|
|
||||||
|
bool will_announce(ptime now) const
|
||||||
|
{
|
||||||
|
return now <= next_announce
|
||||||
|
&& (fails < fail_limit || fail_limit == 0)
|
||||||
|
&& !updating;
|
||||||
|
}
|
||||||
|
|
||||||
bool can_announce(ptime now) const
|
bool can_announce(ptime now) const
|
||||||
{
|
{
|
||||||
return now >= next_announce
|
return now >= next_announce
|
||||||
|
|
|
@ -5477,14 +5477,14 @@ namespace libtorrent
|
||||||
if (i->is_working()) { tier = i->tier; found_working = false; }
|
if (i->is_working()) { tier = i->tier; found_working = false; }
|
||||||
if (i->fails >= i->fail_limit && i->fail_limit != 0) continue;
|
if (i->fails >= i->fail_limit && i->fail_limit != 0) continue;
|
||||||
if (i->updating) { found_working = true; continue; }
|
if (i->updating) { found_working = true; continue; }
|
||||||
if (i->is_working())
|
ptime next_tracker_announce = (std::max)(i->next_announce, i->min_announce);
|
||||||
{
|
if (!i->updating
|
||||||
ptime next_tracker_announce = (std::max)(i->next_announce, i->min_announce);
|
&& next_tracker_announce < next_announce
|
||||||
if (!i->updating && next_tracker_announce < next_announce) next_announce = next_tracker_announce;
|
&& (!found_working || i->is_working()))
|
||||||
found_working = true;
|
next_announce = next_tracker_announce;
|
||||||
if (!settings().announce_to_all_trackers
|
if (i->is_working()) found_working = true;
|
||||||
&& !settings().announce_to_all_tiers) break;
|
if (!settings().announce_to_all_trackers
|
||||||
}
|
&& !settings().announce_to_all_tiers) break;
|
||||||
}
|
}
|
||||||
if (next_announce == max_time()) return;
|
if (next_announce == max_time()) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue