forked from premiere/premiere-libtorrent
fixed bug where event=completed would not be sent if it violated the min-interval
This commit is contained in:
parent
29e45c8cbb
commit
a17f4e4e71
|
@ -41,6 +41,8 @@
|
|||
incoming connection
|
||||
* added more detailed instrumentation of the disk I/O thread
|
||||
|
||||
* fixed announce bug where event=completed would not be sent if it violated the
|
||||
min-announce of the tracker
|
||||
* fixed limitation in rate limiter
|
||||
* fixed build error with boost 1.44
|
||||
|
||||
|
|
|
@ -160,13 +160,7 @@ namespace libtorrent
|
|||
&& !updating;
|
||||
}
|
||||
|
||||
bool can_announce(ptime now) const
|
||||
{
|
||||
return now >= next_announce
|
||||
&& now >= min_announce
|
||||
&& (fails < fail_limit || fail_limit == 0)
|
||||
&& !updating;
|
||||
}
|
||||
bool can_announce(ptime now, bool is_seed) const;
|
||||
|
||||
bool is_working() const
|
||||
{ return fails == 0; }
|
||||
|
|
|
@ -1452,7 +1452,7 @@ namespace libtorrent
|
|||
|
||||
if (ae.tier > tier && !settings().announce_to_all_tiers) break;
|
||||
if (ae.is_working()) { tier = ae.tier; sent_announce = false; }
|
||||
if (!ae.can_announce(now))
|
||||
if (!ae.can_announce(now, is_seed()))
|
||||
{
|
||||
if (ae.is_working())
|
||||
{
|
||||
|
|
|
@ -418,6 +418,18 @@ namespace libtorrent
|
|||
updating = false;
|
||||
}
|
||||
|
||||
bool announce_entry::can_announce(ptime now, bool is_seed) const
|
||||
{
|
||||
// if we're a seed and we haven't sent a completed
|
||||
// event, we need to let this announce through
|
||||
if (is_seed && !complete_sent) return true;
|
||||
|
||||
return now >= next_announce
|
||||
&& now >= min_announce
|
||||
&& (fails < fail_limit || fail_limit == 0)
|
||||
&& !updating;
|
||||
}
|
||||
|
||||
void announce_entry::trim()
|
||||
{
|
||||
while (!url.empty() && is_space(url[0]))
|
||||
|
|
Loading…
Reference in New Issue