(trunk, libT) #5432 'on scrape and announce failures, the retry interval is longer than intended' -- fixed.

This commit is contained in:
Jordan Lee 2013-07-21 21:10:28 +00:00
parent 773d276fb5
commit 4787364b1a
1 changed files with 8 additions and 5 deletions

View File

@ -962,13 +962,16 @@ tr_announcerRemoveTorrent (tr_announcer * announcer, tr_torrent * tor)
static int
getRetryInterval (const tr_tracker * t)
{
assert (t->consecutiveFailures >= 1);
switch (t->consecutiveFailures)
{
case 0: return 20;
case 1: return tr_cryptoWeakRandInt (60) + (60 * 5);
case 2: return tr_cryptoWeakRandInt (60) + (60 * 15);
case 3: return tr_cryptoWeakRandInt (60) + (60 * 30);
case 4: return tr_cryptoWeakRandInt (60) + (60 * 60);
case 0: return 0;
case 1: return 20;
case 2: return tr_cryptoWeakRandInt (60) + (60 * 5);
case 3: return tr_cryptoWeakRandInt (60) + (60 * 15);
case 4: return tr_cryptoWeakRandInt (60) + (60 * 30);
case 5: return tr_cryptoWeakRandInt (60) + (60 * 60);
default: return tr_cryptoWeakRandInt (60) + (60 * 120);
}
}