(libT) #1045: gracefully handle trackers that return a scrape interval that's too low

This commit is contained in:
Charles Kerr 2008-07-02 01:17:57 +00:00
parent 5493046090
commit 70e21e93ff
1 changed files with 5 additions and 0 deletions

View File

@ -491,6 +491,11 @@ onScrapeResponse( tr_session * session,
if(( tr_bencDictFindInt( flags, "min_request_interval", &itmp )))
t->scrapeIntervalSec = i;
/* as per ticket #1045, safeguard against trackers returning
* a very low min_request_interval... */
if( t->scrapeIntervalSec < DEFAULT_SCRAPE_INTERVAL_SEC )
t->scrapeIntervalSec = DEFAULT_SCRAPE_INTERVAL_SEC;
tr_ndbg( t->name, "Scrape successful. Rescraping in %d seconds.",
t->scrapeIntervalSec );