forked from premiere/premiere-libtorrent
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
|
||||
* 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
|
||||
* fixed potential issue where a piece could be checked twice
|
||||
* 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"
|
||||
, i->tier, i->url.c_str(), i->fails, i->verified?"OK ":"- "
|
||||
, i->updating?"updating"
|
||||
:!i->verified?""
|
||||
:!i->will_announce(now)?""
|
||||
:to_string(total_seconds(i->next_announce - now), 8).c_str()
|
||||
, i->last_error ? i->last_error.message().c_str() : ""
|
||||
, i->message.c_str());
|
||||
|
|
|
@ -149,6 +149,13 @@ namespace libtorrent
|
|||
|
||||
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
|
||||
{
|
||||
return now >= next_announce
|
||||
|
|
|
@ -5477,14 +5477,14 @@ namespace libtorrent
|
|||
if (i->is_working()) { tier = i->tier; found_working = false; }
|
||||
if (i->fails >= i->fail_limit && i->fail_limit != 0) 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 && next_tracker_announce < next_announce) next_announce = next_tracker_announce;
|
||||
found_working = true;
|
||||
if (!settings().announce_to_all_trackers
|
||||
&& !settings().announce_to_all_tiers) break;
|
||||
}
|
||||
ptime next_tracker_announce = (std::max)(i->next_announce, i->min_announce);
|
||||
if (!i->updating
|
||||
&& next_tracker_announce < next_announce
|
||||
&& (!found_working || i->is_working()))
|
||||
next_announce = next_tracker_announce;
|
||||
if (i->is_working()) found_working = true;
|
||||
if (!settings().announce_to_all_trackers
|
||||
&& !settings().announce_to_all_tiers) break;
|
||||
}
|
||||
if (next_announce == max_time()) return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue