Changeset 2821


Ignore:
Timestamp:
Aug 17, 2007, 5:00:59 AM (15 years ago)
Author:
charles
Message:

don't cache the connection; these are one-shot requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r2820 r2821  
    127127    tr_timer_tag reannounceTag;
    128128
    129     struct evhttp_connection * httpConn;
    130129    struct evhttp_request * httpReq;
    131130
     
    863862    }
    864863
    865     tor->httpConn = NULL;
    866864    tor->httpReq = NULL;
    867865
     
    884882    const tr_tracker_info_t * address = getCurrentAddress( tor->tracker );
    885883    char * uri = buildTrackerRequestURI( tor, eventName );
     884    struct evhttp_connection * evcon = NULL;
    886885
    887886    tr_inf( "tracker request to %s:%d: %s", address->address,
     
    891890    tr_timerFree( &tor->reannounceTag );
    892891
    893     /* make a connection if we don't have one */
    894     if( tor->httpConn == NULL )
    895         tor->httpConn = evhttp_connection_new( address->address,
    896                                                address->port );
    897     if ( tor->httpConn == NULL )
     892    evcon = evhttp_connection_new( address->address, address->port );
     893    if ( !evcon )
    898894        tr_err( "Can't make a connection to %s:%d", address->address, address->port );
    899895    else {
    900896        tr_free( tor->lastRequest );
    901897        tor->lastRequest = tr_strdup( eventName );
    902         evhttp_connection_set_timeout( tor->httpConn, REQ_TIMEOUT_INTERVAL_SEC );
     898        evhttp_connection_set_timeout( evcon, REQ_TIMEOUT_INTERVAL_SEC );
    903899        tor->httpReq = evhttp_request_new( onTrackerResponse, tor );
    904900        addCommonHeaders( tor->tracker, tor->httpReq );
    905         evhttp_make_request( tor->httpConn, tor->httpReq, EVHTTP_REQ_GET, uri );
     901        evhttp_make_request( evcon, tor->httpReq, EVHTTP_REQ_GET, uri );
    906902    }
    907903
Note: See TracChangeset for help on using the changeset viewer.