1
0
Fork 0
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:
Charles Kerr 2009-06-01 18:24:30 +00:00
parent f538b08fb3
commit 6508dc3a3d

View file

@ -338,17 +338,21 @@ callback( void *ignore UNUSED, int event,
int int
tr_dhtAnnounce(tr_torrent *tor, tr_bool announce) tr_dhtAnnounce(tr_torrent *tor, tr_bool announce)
{ {
int rc;
if( !tr_torrentAllowsDHT( tor ) ) if( !tr_torrentAllowsDHT( tor ) )
return -1; return -1;
if( tr_dhtStatus( tor->session, NULL ) < TR_DHT_POOR ) if( tr_dhtStatus( tor->session, NULL ) < TR_DHT_POOR )
return 0; return 0;
dht_search( dht_socket, tor->info.hash, rc = dht_search( dht_socket, tor->info.hash,
announce ? tr_sessionGetPeerPort(session) : 0, announce ? tr_sessionGetPeerPort(session) : 0,
callback, NULL); callback, NULL);
if( rc >= 1 )
tor->dhtAnnounceInProgress = TRUE;
tor->dhtAnnounceInProgress = TRUE;
return 1; return 1;
} }