Changeset 4065 for trunk/libtransmission/tracker.c
- Timestamp:
- Dec 5, 2007, 2:06:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/tracker.c
r4024 r4065 380 380 } 381 381 382 static void 383 onTrackerResponse( struct evhttp_request * req, void * torrent_hash ) 382 static void onReqDone( tr_handle * handle ); 383 384 static void 385 onTrackerResponse( struct evhttp_request * req, void * vhash ) 384 386 { 385 387 const char * warning; 386 tr_tracker * t;387 388 int responseCode; 388 389 t = findTrackerFromHash( torrent_hash ); 389 struct torrent_hash * torrent_hash = (struct torrent_hash*) vhash; 390 tr_tracker * t = findTrackerFromHash( torrent_hash ); 391 392 onReqDone( torrent_hash->handle ); 390 393 tr_free( torrent_hash ); 394 391 395 if( t == NULL ) /* tracker has been closed */ 392 396 return; … … 540 544 const char * warning; 541 545 time_t nextScrapeSec = 60; 542 tr_tracker * t = findTrackerFromHash( vhash ); 546 struct torrent_hash * torrent_hash = (struct torrent_hash*) vhash; 547 tr_tracker * t = findTrackerFromHash( torrent_hash ); 548 549 onReqDone( torrent_hash->handle ); 550 tr_free( torrent_hash ); 543 551 544 552 dbgmsg( t, "Got scrape response for '%s': %s (%d)", (t ? t->name : "(null)"), (req ? req->response_code_line : "(no line)"), (req ? req->response_code : -1) ); 545 553 546 tr_free( vhash );547 554 if( t == NULL ) /* tracker's been closed... */ 548 555 return; … … 818 825 tr_handle * handle = vhandle; 819 826 820 assert( handle );821 assert( handle->tracker );822 823 827 /* libevent references evcon right after calling this function, 824 828 so we can't free it yet... defer it to after this call chain 825 829 has played out */ 826 830 tr_timerNew( handle, freeConnection, evcon, 100 ); 827 828 --handle->tracker->socketCount;829 dbgmsg( NULL, "decrementing socket count to %d", handle->tracker->socketCount );830 pulse( handle );831 831 } 832 832 … … 930 930 } 931 931 932 static void 933 onReqDone( tr_handle * handle ) 934 { 935 pulse( handle ); 936 --handle->tracker->socketCount; 937 dbgmsg( NULL, "decrementing socket count to %d", handle->tracker->socketCount ); 938 } 939 932 940 /*** 933 941 **** LIFE CYCLE
Note: See TracChangeset
for help on using the changeset viewer.