fixed bug where event=completed would not be sent if it violated the min-interval

This commit is contained in:
Arvid Norberg 2010-09-01 03:14:12 +00:00
parent 29e45c8cbb
commit a17f4e4e71
4 changed files with 16 additions and 8 deletions

View File

@ -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

View File

@ -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; }

View File

@ -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())
{

View File

@ -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]))