Changeset 9429


Ignore:
Timestamp:
Oct 28, 2009, 4:53:39 AM (13 years ago)
Author:
charles
Message:

(trunk libT) #2530: Announce attempt to invalid tracker occurs too often

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r9419 r9429  
    12071207                        sizeof( tier->lastAnnounceStr ) );
    12081208
     1209            tier->lastAnnounceTime = now;
     1210
    12091211            /* if the response is serious, *and* if the response may require
    12101212             * human intervention, then notify the user... otherwise just log it */
     
    12701272                publishErrorMessageAndStop( tier, _( "Tracker returned a 4xx message" ) );
    12711273            tier->manualAnnounceAllowedAt = ~(time_t)0;
     1274            tierClearNextAnnounce( tier );
    12721275        }
    12731276        else if( 500 <= responseCode && responseCode <= 599 )
     
    14771480            const int interval = tier->retryScrapeIntervalSec;
    14781481            tier->retryScrapeIntervalSec *= 2;
    1479             tier->scrapeAt = now + interval;
     1482
     1483            /* Don't retry on a 4xx.
     1484             * Retry at growing intervals on a 5xx */
     1485            if( 400 <= responseCode && responseCode <= 499 )
     1486                tier->scrapeAt = 0;
     1487            else
     1488                tier->scrapeAt = now + interval;
    14801489
    14811490            /* %1$ld - http status code, such as 404
     
    15591568{
    15601569    return !tier->isScraping
     1570        && ( tier->scrapeAt != 0 )
    15611571        && ( tier->scrapeAt <= now )
    15621572        && ( tier->currentTracker != NULL )
     
    17121722                if( tier->isScraping )
    17131723                    st->scrapeState = TR_TRACKER_ACTIVE;
     1724                else if( !tier->scrapeAt )
     1725                    st->scrapeState = TR_TRACKER_INACTIVE;
    17141726                else if( tier->scrapeAt > now )
    17151727                {
     
    17321744                if( tier->isAnnouncing )
    17331745                    st->announceState = TR_TRACKER_ACTIVE;
    1734                 else if( !torrent->isRunning )
     1746                else if( !torrent->isRunning || !tier->announceAt )
    17351747                    st->announceState = TR_TRACKER_INACTIVE;
    17361748                else if( tier->announceAt > now )
Note: See TracChangeset for help on using the changeset viewer.