From: Jordan Lee Date: Tue, 16 Jul 2013 00:13:30 +0000 (+0000) Subject: (trunk, libT) #5395: when announces fail, lower the period before the first retry... X-Git-Tag: 2.81~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee130e773d3a63f41509b25a0a85ed936d393088;p=transmission (trunk, libT) #5395: when announces fail, lower the period before the first retry to fix unspecified 'network problems'. --- diff --git a/libtransmission/announcer.c b/libtransmission/announcer.c index 07c7cd24e..37697272e 100644 --- a/libtransmission/announcer.c +++ b/libtransmission/announcer.c @@ -962,17 +962,15 @@ tr_announcerRemoveTorrent (tr_announcer * announcer, tr_torrent * tor) static int getRetryInterval (const tr_tracker * t) { - int minutes; - const unsigned int jitter_seconds = tr_cryptoWeakRandInt (60); - switch (t->consecutiveFailures) { - case 0: minutes = 1; break; - case 1: minutes = 5; break; - case 2: minutes = 15; break; - case 3: minutes = 30; break; - case 4: minutes = 60; break; - default: minutes = 120; break; + 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); + default: return tr_cryptoWeakRandInt (60) + (60 * 120); } - return (minutes * 60) + jitter_seconds; } struct announce_data