mirror of
https://github.com/transmission/transmission
synced 2025-01-31 03:12:44 +00:00
Make the initial DHT bootstrap more persistent.
We now try to contact the bootstrap nodes up to six times. A better solution might be to reattempt bootstrap every half hour or so. This might be beneficial to people whose connectivity changes while Transmission is running.
This commit is contained in:
parent
d591767941
commit
6cf281a311
1 changed files with 14 additions and 8 deletions
|
@ -230,15 +230,21 @@ dht_bootstrap(void *closure)
|
||||||
tr_free( bootstrap_file );
|
tr_free( bootstrap_file );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We really don't want to abuse our bootstrap nodes.
|
|
||||||
Be glacially slow. */
|
|
||||||
if(!bootstrap_done(cl->session, 0))
|
|
||||||
nap(30);
|
|
||||||
|
|
||||||
if(!bootstrap_done(cl->session, 0)) {
|
if(!bootstrap_done(cl->session, 0)) {
|
||||||
tr_ninf("DHT", "Attempting bootstrap from dht.transmissionbt.com");
|
for(i = 0; i < 6; i++) {
|
||||||
bootstrap_from_name( "dht.transmissionbt.com", 6881,
|
/* We don't want to abuse our bootstrap nodes, so be very
|
||||||
bootstrap_af(session) );
|
slow. The initial wait is to give other nodes a chance
|
||||||
|
to contact us before we attempt to contact a bootstrap
|
||||||
|
node, for example because we've just been restarted. */
|
||||||
|
nap(40);
|
||||||
|
if(bootstrap_done(cl->session, 0))
|
||||||
|
break;
|
||||||
|
if(i == 0)
|
||||||
|
tr_ninf("DHT",
|
||||||
|
"Attempting bootstrap from dht.transmissionbt.com");
|
||||||
|
bootstrap_from_name( "dht.transmissionbt.com", 6881,
|
||||||
|
bootstrap_af(session) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cl->nodes )
|
if( cl->nodes )
|
||||||
|
|
Loading…
Reference in a new issue