Changeset 3331


Ignore:
Timestamp:
Oct 8, 2007, 5:05:39 PM (15 years ago)
Author:
charles
Message:

give trackers more time before timing out the requests. make the `stopping' timeout interval smaller than other intervals so that we don't block for too long during shutdown.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r3318 r3331  
    4646
    4747/* this is how long we'll leave a request hanging before timeout */
    48 #define TIMEOUT_INTERVAL_SEC 5
     48#define TIMEOUT_INTERVAL_SEC 40
     49#define STOPPING_TIMEOUT_INTERVAL_SEC 8
    4950
    5051/* the value of the 'numwant' argument passed in tracker requests */
     
    172173{
    173174    struct evhttp_connection * c = evhttp_connection_new( address, port );
    174     evhttp_connection_set_timeout( c, TIMEOUT_INTERVAL_SEC );
    175175    evhttp_connection_set_closecb( c, connectionClosedCB, tracker->handle );
    176176    return c;
     
    709709                address->address, address->port, uri );
    710710        evcon = getConnection( t, address->address, address->port );
     711        evhttp_connection_set_timeout( evcon, TIMEOUT_INTERVAL_SEC );
    711712        req = evhttp_request_new( onScrapeResponse, t );
    712713        assert( req );
     
    995996        tr_free( t->lastRequest );
    996997        t->lastRequest = tr_strdup( eventName );
    997         if( eventName && !strcmp( eventName, "stopped" ) )
     998        if( !eventName || !strcmp( eventName, "stopped" ) ) {
     999            evhttp_connection_set_timeout( evcon, TIMEOUT_INTERVAL_SEC );
     1000            httpReq = evhttp_request_new( onTrackerResponse, onTrackerResponseDataNew(t) );
     1001        } else {
     1002            evhttp_connection_set_timeout( evcon, STOPPING_TIMEOUT_INTERVAL_SEC );
    9981003            httpReq = evhttp_request_new( onStoppedResponse, t->tracker->handle );
    999         else
    1000             httpReq = evhttp_request_new( onTrackerResponse, onTrackerResponseDataNew(t) );
     1004        }
    10011005        addCommonHeaders( t->tracker, httpReq );
    10021006        tr_evhttp_make_request( t->tracker->handle, evcon,
Note: See TracChangeset for help on using the changeset viewer.