Ignore:
Timestamp:
Oct 9, 2007, 4:50:10 AM (15 years ago)
Author:
charles
Message:

fix recent tracker error reported by John_Clay that made it slower to pick up peers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r3336 r3337  
    4949#define STOPPING_TIMEOUT_INTERVAL_SEC 8
    5050
    51 /* the value of the 'numwant' argument passed in tracker requests */
    52 #define NUMWANT 128
     51/* the value of the 'numwant' argument passed in tracker requests.
     52 * this should be big, but if it's *too* big trackers will ignore it */
     53#define NUMWANT 50
    5354
    5455/* the length of the 'key' argument passed in tracker requests */
     
    745746                        const char        * eventName )
    746747{
    747     const int stopping = !strcmp( eventName, "stopped" );
    748     const int numwant = stopping ? 0 : NUMWANT;
     748    const int isStopping = !strcmp( eventName, "stopped" );
     749    const int numwant = isStopping ? 0 : NUMWANT;
    749750    char buf[4096];
    750751
     
    976977{
    977978    Torrent * t = (Torrent *) vt;
     979    const int isStopping = eventName && !strcmp( eventName, "stopped" );
    978980    const tr_tracker_info * address = getCurrentAddress( t->tracker );
    979981    char * uri;
     
    10041006        tr_free( t->lastRequest );
    10051007        t->lastRequest = tr_strdup( eventName );
    1006         if( !eventName || !strcmp( eventName, "stopped" ) ) {
     1008        if( isStopping ) {
     1009            evhttp_connection_set_timeout( evcon, STOPPING_TIMEOUT_INTERVAL_SEC );
     1010            httpReq = evhttp_request_new( onStoppedResponse, t->tracker->handle );
     1011        } else {
    10071012            evhttp_connection_set_timeout( evcon, TIMEOUT_INTERVAL_SEC );
    10081013            httpReq = evhttp_request_new( onTrackerResponse, onTrackerResponseDataNew(t) );
    1009         } else {
    1010             evhttp_connection_set_timeout( evcon, STOPPING_TIMEOUT_INTERVAL_SEC );
    1011             httpReq = evhttp_request_new( onStoppedResponse, t->tracker->handle );
    10121014        }
    10131015        addCommonHeaders( t->tracker, httpReq );
Note: See TracChangeset for help on using the changeset viewer.