Changeset 7102


Ignore:
Timestamp:
Nov 12, 2008, 4:27:02 AM (12 years ago)
Author:
charles
Message:

(libT) #1447: Tracker request failed. Got HTTP Status Code: 0 (No Response)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r6971 r7102  
    258258        /* multitracker spec: "if a connection with a tracker is
    259259           successful, it will be moved to the front of the tier." */
    260         t->trackerIndex = tr_torrentPromoteTracker( torrent,
    261                                                     t->trackerIndex );
     260        t->trackerIndex = tr_torrentPromoteTracker( torrent, t->trackerIndex );
    262261        retry = FALSE; /* we succeeded; no need to retry */
    263262    }
     
    269268    else
    270269    {
    271         const tr_tracker_info * n = getCurrentAddressFromTorrent( t,
    272                                                                   torrent );
     270        const tr_tracker_info * n = getCurrentAddressFromTorrent( t, torrent );
    273271        tr_ninf( t->name, _( "Trying tracker \"%s\"" ), n->announce );
    274272        retry = TRUE;
     
    445443            tr_bencFree( &benc );
    446444    }
    447     else
     445    else if( responseCode )
    448446    {
    449447        /* %1$ld - http status code, such as 404
     
    458456    retry = updateAddresses( t, success );
    459457
    460     /**
    461     ***
    462     **/
    463 
    464     if( retry )
     458    if( responseCode && retry )
    465459        responseCode = 300;
    466460
    467     if( 200 <= responseCode && responseCode <= 299 )
     461    if( responseCode == 0 )
     462    {
     463        dbgmsg( t->name, "No response from tracker... retrying in two minutes." );
     464        t->manualAnnounceAllowedAt = ~(time_t)0;
     465        t->reannounceAt = time( NULL ) + t->randOffset + 120;
     466    }
     467    else if( 200 <= responseCode && responseCode <= 299 )
    468468    {
    469469        const int    interval = t->announceIntervalSec + t->randOffset;
    470470        const time_t now = time ( NULL );
    471         dbgmsg( t->name, "request succeeded. reannouncing in %d seconds",
    472                 interval );
     471        dbgmsg( t->name, "request succeeded. reannouncing in %d seconds", interval );
    473472
    474473        /* if the announce response was a superset of the scrape response,
     
    500499        dbgmsg( t->name, "got a redirect. retrying in %d seconds", interval );
    501500        t->reannounceAt = time( NULL ) + interval;
    502         t->manualAnnounceAllowedAt = time( NULL ) +
    503                                      t->announceMinIntervalSec;
     501        t->manualAnnounceAllowedAt = time( NULL ) + t->announceMinIntervalSec;
    504502    }
    505503    else if( 400 <= responseCode && responseCode <= 499 )
     
    525523    {
    526524        /* WTF did we get?? */
    527         dbgmsg(
    528             t->name,
    529             "Invalid response from tracker... retrying in two minutes." );
     525        dbgmsg( t->name, "Invalid response from tracker... retrying in two minutes." );
    530526        t->manualAnnounceAllowedAt = ~(time_t)0;
    531527        t->reannounceAt = time( NULL ) + t->randOffset + 120;
Note: See TracChangeset for help on using the changeset viewer.