Changeset 4008


Ignore:
Timestamp:
Nov 29, 2007, 2:31:21 AM (14 years ago)
Author:
charles
Message:

throw away all pending `scrape' requests on shutdown... we don't need them then, so they just slow us down

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r4004 r4008  
    621621
    622622static void
    623 freeRequest( struct tr_tracker_request ** req )
    624 {
    625     tr_free( (*req)->address );
    626     tr_free( (*req)->uri );
    627     tr_free( (*req) );
    628     *req = NULL;
     623freeRequest( struct tr_tracker_request * req )
     624{
     625    tr_free( req->address );
     626    tr_free( req->uri );
     627    tr_free( req );
    629628}
    630629
     
    753752}
    754753
     754static void
     755freeRequest2( void * req )
     756{
     757    freeRequest( req );
     758}
     759
     760void
     761tr_trackerShuttingDown( tr_handle * handle )
     762{
     763    /* since we're shutting down, we don't need to scrape anymore... */
     764    if( handle->tracker )
     765        tr_list_free( &handle->tracker->scrapeQueue, freeRequest2 );
     766}
     767
    755768static int
    756769maybeFreeGlobals( tr_handle * handle )
     
    824837    struct tr_tracker_request * req = tr_list_pop_front( list );
    825838    invokeRequest( handle, req );
    826     freeRequest( &req );
     839    freeRequest( req );
    827840}
    828841
  • trunk/libtransmission/tracker.h

    r3451 r4008  
    2727
    2828void  tr_trackerFree ( tr_tracker * );
     29
     30void  tr_trackerShuttingDown( tr_handle * );
    2931
    3032/**
  • trunk/libtransmission/transmission.c

    r4004 r4008  
    4343#include "shared.h"
    4444#include "stats.h"
     45#include "tracker.h"
    4546#include "trevent.h"
    4647#include "utils.h"
     
    323324    tr_handle * h = vh;
    324325    tr_torrent * t;
     326
     327    tr_trackerShuttingDown( h );
    325328
    326329    for( t=h->torrentList; t!=NULL; t=t->next )
Note: See TracChangeset for help on using the changeset viewer.