t->scrapeIntervalSec = DEFAULT_SCRAPE_INTERVAL_SEC;
t->announceIntervalSec = DEFAULT_ANNOUNCE_INTERVAL_SEC;
t->announceMinIntervalSec = DEFAULT_ANNOUNCE_MIN_INTERVAL_SEC;
- t->scrapeAt = now + tr_cryptoWeakRandInt( 60*10 );
+ t->scrapeAt = now + tr_cryptoWeakRandInt( 60*5 );
t->tor = tor;
return t;
parseAnnounceResponse( tr_tier * tier,
const char * response,
size_t responseLen,
- tr_bool isStopped,
tr_bool * gotScrape )
{
tr_benc benc;
tr_benc * tmp;
const char * str;
const uint8_t * raw;
+ tr_bool gotPeers = FALSE;
success = TRUE;
/* "compact" extension */
const int allAreSeeds = incomplete == 0;
peerCount += publishNewPeersCompact( tier, allAreSeeds, raw, rawlen );
+ gotPeers = TRUE;
}
else if( tr_bencDictFindList( &benc, "peers", &tmp ) )
{
size_t byteCount = 0;
uint8_t * array = parseOldPeers( tmp, &byteCount );
peerCount += publishNewPeers( tier, allAreSeeds, array, byteCount );
+ gotPeers = TRUE;
tr_free( array );
}
/* "compact" extension */
const tr_bool allAreSeeds = incomplete == 0;
peerCount += publishNewPeersCompact6( tier, allAreSeeds, raw, rawlen );
+ gotPeers = TRUE;
}
if( tier->lastAnnounceStr[0] == '\0' )
tr_strlcpy( tier->lastAnnounceStr, _( "Success" ),
sizeof( tier->lastAnnounceStr ) );
- if( !isStopped )
+ if( gotPeers )
tier->lastAnnouncePeerCount = peerCount;
}
if( responseCode == HTTP_OK )
{
- success = parseAnnounceResponse( tier, response, responseLen, isStopped, &gotScrape );
+ success = parseAnnounceResponse( tier, response, responseLen, &gotScrape );
dbgmsg( tier, "success is %d", success );
if( isStopped )