(maybe) fix shutdown crash in "pulse" reported by pea_
This commit is contained in:
parent
6671750eda
commit
7582f4a929
|
@ -904,6 +904,9 @@ pulse( void * vhandle )
|
||||||
tr_torrent * tor;
|
tr_torrent * tor;
|
||||||
const time_t now = time( NULL );
|
const time_t now = time( NULL );
|
||||||
|
|
||||||
|
if( handle->tracker == NULL )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if( handle->tracker->socketCount || tr_list_size(th->requestQueue) || tr_list_size(th->scrapeQueue) )
|
if( handle->tracker->socketCount || tr_list_size(th->requestQueue) || tr_list_size(th->scrapeQueue) )
|
||||||
dbgmsg( NULL, "tracker pulse... %d sockets, %d reqs left, %d scrapes left", handle->tracker->socketCount, tr_list_size(th->requestQueue), tr_list_size(th->scrapeQueue) );
|
dbgmsg( NULL, "tracker pulse... %d sockets, %d reqs left, %d scrapes left", handle->tracker->socketCount, tr_list_size(th->requestQueue), tr_list_size(th->scrapeQueue) );
|
||||||
|
|
||||||
|
@ -941,9 +944,12 @@ pulse( void * vhandle )
|
||||||
static void
|
static void
|
||||||
onReqDone( tr_handle * handle )
|
onReqDone( tr_handle * handle )
|
||||||
{
|
{
|
||||||
pulse( handle );
|
if( handle->tracker )
|
||||||
--handle->tracker->socketCount;
|
{
|
||||||
dbgmsg( NULL, "decrementing socket count to %d", handle->tracker->socketCount );
|
pulse( handle );
|
||||||
|
--handle->tracker->socketCount;
|
||||||
|
dbgmsg( NULL, "decrementing socket count to %d", handle->tracker->socketCount );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|
Loading…
Reference in New Issue