Changeset 3937


Ignore:
Timestamp:
Nov 23, 2007, 3:01:13 AM (15 years ago)
Author:
charles
Message:

fix oops from last commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r3935 r3937  
    150150***/
    151151
    152 #if 0
    153152static int
    154153freeConnection( void * evcon )
     
    166165    tr_timerNew( handle, freeConnection, evcon, 100 );
    167166}
    168 #endif
    169167
    170168static struct evhttp_connection*
     
    172170{
    173171    struct evhttp_connection * c = evhttp_connection_new( address, port );
    174     //evhttp_connection_set_closecb( c, connectionClosedCB, t->handle );
     172    evhttp_connection_set_closecb( c, connectionClosedCB, t->handle );
    175173    return c;
    176174}
     
    989987}
    990988
     989struct request_data
     990{
     991    tr_tracker * t;
     992    const char * command;
     993};
     994
     995static void
     996sendRequestFromEventThreadImpl( void * vdata )
     997{
     998    struct request_data * data = vdata;
     999    sendTrackerRequest( data->t, data->command );
     1000    tr_free( data );
     1001}
     1002
     1003static void
     1004sendRequestFromEventThread( tr_tracker * t, const char * command )
     1005{
     1006    struct request_data * data = tr_new( struct request_data, 1 );
     1007    data->t = t;
     1008    data->command = command;
     1009    tr_runInEventThread( t->handle, sendRequestFromEventThreadImpl, data );
     1010}
     1011
    9911012void
    9921013tr_trackerStart( tr_tracker * t )
     
    9971018    {
    9981019        t->isRunning = 1;
    999         sendTrackerRequest( t, "started" );
     1020        sendRequestFromEventThread( t, "started" );
    10001021    }
    10011022}
     
    10041025tr_trackerReannounce( tr_tracker * t )
    10051026{
    1006     sendTrackerRequest( t, "started" );
     1027    sendRequestFromEventThread( t, "started" );
    10071028}
    10081029
     
    10101031tr_trackerCompleted( tr_tracker * t )
    10111032{
    1012     sendTrackerRequest( t, "completed" );
     1033    sendRequestFromEventThread( t, "completed" );
    10131034}
    10141035
     
    10161037tr_trackerStop( tr_tracker * t )
    10171038{
    1018 dbgmsg( t, " tr_trackerStop called .... t->isRunning is %d", (int)t->isRunning );
    10191039    if( t->isRunning )
    10201040    {
    10211041        t->isRunning = 0;
    1022         sendTrackerRequest( t, "stopped" );
     1042        sendRequestFromEventThread( t, "stopped" );
    10231043    }
    10241044}
Note: See TracChangeset for help on using the changeset viewer.