fix tracker redirect bug reported by sunny

This commit is contained in:
Charles Kerr 2007-11-15 14:34:48 +00:00
parent 257eaee631
commit cc42c8aaf6
2 changed files with 10 additions and 3 deletions

4
NEWS
View File

@ -10,6 +10,10 @@ NEWS file for Transmission <http://transmission.m0k.org/>
+ Pieces Bar (return of Advanced Bar) + Pieces Bar (return of Advanced Bar)
+ Availability Bar (overlay on regular bar) + Availability Bar (overlay on regular bar)
0.94 (2007/xx/yy)
- All Platforms:
+ Fix tracker redirect error (ticket #482)
0.93 (2007/12/11) 0.93 (2007/12/11)
- All Platforms: - All Platforms:
+ Fix "router death" bug that impaired internet connectivity + Fix "router death" bug that impaired internet connectivity

View File

@ -427,7 +427,8 @@ getCurrentAddress( const tr_tracker * t )
assert( t->addressIndex >= 0 ); assert( t->addressIndex >= 0 );
assert( t->addressIndex < t->addressCount ); assert( t->addressIndex < t->addressCount );
return &t->addresses[t->addressIndex]; return t->redirect ? t->redirect
: t->addresses + t->addressIndex;
} }
static int static int
trackerSupportsScrape( const tr_tracker * t ) trackerSupportsScrape( const tr_tracker * t )
@ -894,8 +895,10 @@ sendTrackerRequest( void * vt, const char * eventName )
tr_free( uri ); tr_free( uri );
} else { } else {
struct evhttp_request * req; struct evhttp_request * req;
if( eventName != t->lastRequest ) {
tr_free( t->lastRequest ); tr_free( t->lastRequest );
t->lastRequest = tr_strdup( eventName ); t->lastRequest = tr_strdup( eventName );
}
if( isStopping ) { if( isStopping ) {
evhttp_connection_set_timeout( evcon, STOP_TIMEOUT_INTERVAL_SEC ); evhttp_connection_set_timeout( evcon, STOP_TIMEOUT_INTERVAL_SEC );
req = evhttp_request_new( onStoppedResponse, t->handle ); req = evhttp_request_new( onStoppedResponse, t->handle );