From 8e4d8379673ea22dcdbf9c1e0656e82b8468dab2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 12 Aug 2009 20:12:52 +0000 Subject: [PATCH] (trunk, libT) fix for #2269 ("error message cleared unexpectedly"): a successful scrape clears the error message, and there's no point in scraping an error torrent anyway, so don't scrape until the torrent's error is cleared by a successful announce. --- libtransmission/tracker.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libtransmission/tracker.c b/libtransmission/tracker.c index 2ba47adbf..8014a645a 100644 --- a/libtransmission/tracker.c +++ b/libtransmission/tracker.c @@ -983,8 +983,17 @@ trackerPulse( void * vsession ) && ( t->scrapeAt <= now ) && ( trackerSupportsScrape( t, tor ) ) ) { - t->scrapeAt = TR_TRACKER_BUSY; - enqueueScrape( session, t ); + if( ( tor->error == TR_STAT_TRACKER_ERROR ) || ( tor->error == TR_STAT_LOCAL_ERROR ) ) + { + /* keep deferring the scrape until the errors are resolved. + there's no point in wasting a round trip on this torrent until then. */ + t->scrapeAt = now + t->scrapeIntervalSec + t->randOffset; + } + else + { + t->scrapeAt = TR_TRACKER_BUSY; + enqueueScrape( session, t ); + } } if( ( t->reannounceAt > 1 )