1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

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

This commit is contained in:
Charles Kerr 2008-11-12 04:27:02 +00:00
parent d157577a74
commit 25c33e7bb2

View file

@ -257,8 +257,7 @@ updateAddresses( tr_tracker * t,
{ {
/* multitracker spec: "if a connection with a tracker is /* multitracker spec: "if a connection with a tracker is
successful, it will be moved to the front of the tier." */ successful, it will be moved to the front of the tier." */
t->trackerIndex = tr_torrentPromoteTracker( torrent, t->trackerIndex = tr_torrentPromoteTracker( torrent, t->trackerIndex );
t->trackerIndex );
retry = FALSE; /* we succeeded; no need to retry */ retry = FALSE; /* we succeeded; no need to retry */
} }
else if( ++t->trackerIndex >= torrent->info.trackerCount ) else if( ++t->trackerIndex >= torrent->info.trackerCount )
@ -268,8 +267,7 @@ updateAddresses( tr_tracker * t,
} }
else else
{ {
const tr_tracker_info * n = getCurrentAddressFromTorrent( t, const tr_tracker_info * n = getCurrentAddressFromTorrent( t, torrent );
torrent );
tr_ninf( t->name, _( "Trying tracker \"%s\"" ), n->announce ); tr_ninf( t->name, _( "Trying tracker \"%s\"" ), n->announce );
retry = TRUE; retry = TRUE;
} }
@ -444,7 +442,7 @@ onTrackerResponse( tr_session * session,
if( bencLoaded ) if( bencLoaded )
tr_bencFree( &benc ); tr_bencFree( &benc );
} }
else else if( responseCode )
{ {
/* %1$ld - http status code, such as 404 /* %1$ld - http status code, such as 404
* %2$s - human-readable explanation of the http status code */ * %2$s - human-readable explanation of the http status code */
@ -457,19 +455,20 @@ onTrackerResponse( tr_session * session,
retry = updateAddresses( t, success ); retry = updateAddresses( t, success );
/** if( responseCode && retry )
***
**/
if( retry )
responseCode = 300; responseCode = 300;
if( 200 <= responseCode && responseCode <= 299 ) if( responseCode == 0 )
{
dbgmsg( t->name, "No response from tracker... retrying in two minutes." );
t->manualAnnounceAllowedAt = ~(time_t)0;
t->reannounceAt = time( NULL ) + t->randOffset + 120;
}
else if( 200 <= responseCode && responseCode <= 299 )
{ {
const int interval = t->announceIntervalSec + t->randOffset; const int interval = t->announceIntervalSec + t->randOffset;
const time_t now = time ( NULL ); const time_t now = time ( NULL );
dbgmsg( t->name, "request succeeded. reannouncing in %d seconds", dbgmsg( t->name, "request succeeded. reannouncing in %d seconds", interval );
interval );
/* if the announce response was a superset of the scrape response, /* if the announce response was a superset of the scrape response,
treat this as both a successful announce AND scrape. */ treat this as both a successful announce AND scrape. */
@ -499,8 +498,7 @@ onTrackerResponse( tr_session * session,
const int interval = 5; const int interval = 5;
dbgmsg( t->name, "got a redirect. retrying in %d seconds", interval ); dbgmsg( t->name, "got a redirect. retrying in %d seconds", interval );
t->reannounceAt = time( NULL ) + interval; t->reannounceAt = time( NULL ) + interval;
t->manualAnnounceAllowedAt = time( NULL ) + t->manualAnnounceAllowedAt = time( NULL ) + t->announceMinIntervalSec;
t->announceMinIntervalSec;
} }
else if( 400 <= responseCode && responseCode <= 499 ) else if( 400 <= responseCode && responseCode <= 499 )
{ {
@ -524,9 +522,7 @@ onTrackerResponse( tr_session * session,
else else
{ {
/* WTF did we get?? */ /* WTF did we get?? */
dbgmsg( dbgmsg( t->name, "Invalid response from tracker... retrying in two minutes." );
t->name,
"Invalid response from tracker... retrying in two minutes." );
t->manualAnnounceAllowedAt = ~(time_t)0; t->manualAnnounceAllowedAt = ~(time_t)0;
t->reannounceAt = time( NULL ) + t->randOffset + 120; t->reannounceAt = time( NULL ) + t->randOffset + 120;
} }