mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(trunk libT) #2146: Incorrect maintenance of dhtAnnounceInProgress
This commit is contained in:
parent
f538b08fb3
commit
6508dc3a3d
1 changed files with 8 additions and 4 deletions
|
@ -338,17 +338,21 @@ callback( void *ignore UNUSED, int event,
|
|||
int
|
||||
tr_dhtAnnounce(tr_torrent *tor, tr_bool announce)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if( !tr_torrentAllowsDHT( tor ) )
|
||||
return -1;
|
||||
|
||||
if( tr_dhtStatus( tor->session, NULL ) < TR_DHT_POOR )
|
||||
return 0;
|
||||
|
||||
dht_search( dht_socket, tor->info.hash,
|
||||
rc = dht_search( dht_socket, tor->info.hash,
|
||||
announce ? tr_sessionGetPeerPort(session) : 0,
|
||||
callback, NULL);
|
||||
|
||||
if( rc >= 1 )
|
||||
tor->dhtAnnounceInProgress = TRUE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue