(trunk libT) #3203 "torrents halted after 'Tracker returned a 4xx message'" -- fixed in trunk for 2.00

This commit is contained in:
Charles Kerr 2010-05-11 13:32:29 +00:00
parent da2ef53eeb
commit ad27c9d58e
1 changed files with 14 additions and 10 deletions

View File

@ -1453,6 +1453,20 @@ onAnnounceDone( tr_session * session,
tierAddAnnounce( tier, announceEvent, now + interval );
tier->manualAnnounceAllowedAt = now + tier->announceMinIntervalSec;
}
else if( ( responseCode == 404 ) || ( 500 <= responseCode && responseCode <= 599 ) )
{
/* 404: The requested resource could not be found but may be
* available again in the future. Subsequent requests by
* the client are permissible. */
/* 5xx: indicate cases in which the server is aware that it
* has erred or is incapable of performing the request.
* So we pause a bit and try again. */
const int interval = getRetryInterval( tier->currentTracker->host );
tier->manualAnnounceAllowedAt = ~(time_t)0;
tierAddAnnounce( tier, announceEvent, now + interval );
}
else if( 400 <= responseCode && responseCode <= 499 )
{
/* The request could not be understood by the server due to
@ -1463,16 +1477,6 @@ onAnnounceDone( tr_session * session,
tier->announceAt = 0;
tier->manualAnnounceAllowedAt = ~(time_t)0;
}
else if( 500 <= responseCode && responseCode <= 599 )
{
/* Response status codes beginning with the digit "5" indicate
* cases in which the server is aware that it has erred or is
* incapable of performing the request. So we pause a bit and
* try again. */
const int interval = getRetryInterval( tier->currentTracker->host );
tier->manualAnnounceAllowedAt = ~(time_t)0;
tierAddAnnounce( tier, announceEvent, now + interval );
}
else
{
/* WTF did we get?? */