#895: don't scrape running torrents on startup

This commit is contained in:
Charles Kerr 2008-04-25 16:06:03 +00:00
parent 8b98362e89
commit 37d4da23b7
1 changed files with 5 additions and 2 deletions

View File

@ -410,9 +410,11 @@ onTrackerResponse( tr_session * session,
if( 200<=responseCode && responseCode<=299 )
{
const int interval = t->announceIntervalSec + t->randOffset;
const time_t now = time ( NULL );
dbgmsg( t->name, "request succeeded. reannouncing in %d seconds", interval );
t->reannounceAt = time( NULL ) + interval;
t->manualAnnounceAllowedAt = time( NULL ) + t->announceMinIntervalSec;
t->scrapeAt = now + t->scrapeIntervalSec + t->randOffset;
t->reannounceAt = now + interval;
t->manualAnnounceAllowedAt = now + t->announceMinIntervalSec;
}
else if( 300<=responseCode && responseCode<=399 )
{
@ -728,6 +730,7 @@ invokeRequest( void * vreq )
{
t->lastAnnounceTime = time( NULL );
t->reannounceAt = 0;
t->scrapeAt = 0;
t->manualAnnounceAllowedAt = ~(time_t)0;
}
}