forward port auto-manage fix from RC_1_0

This commit is contained in:
arvidn 2015-09-19 02:10:50 -04:00
parent 2715ae475c
commit cf15453388
2 changed files with 8 additions and 7 deletions

View File

@ -74,6 +74,7 @@
* added support for hashing pieces in multiple threads * added support for hashing pieces in multiple threads
* fix auto-manage bug with announce to tracker/lsd/dht limits
* improve DHT routing table to not create an unbalanced tree * improve DHT routing table to not create an unbalanced tree
* fix bug in uTP that would cause any connection taking more than one second * fix bug in uTP that would cause any connection taking more than one second
to connect be timed out (introduced in the vulnerability path) to connect be timed out (introduced in the vulnerability path)

View File

@ -3577,15 +3577,12 @@ retry:
TORRENT_ASSERT(t->state() != torrent_status::checking_files); TORRENT_ASSERT(t->state() != torrent_status::checking_files);
--dht_limit;
--lsd_limit;
--tracker_limit;
t->set_announce_to_dht(dht_limit >= 0);
t->set_announce_to_trackers(tracker_limit >= 0);
t->set_announce_to_lsd(lsd_limit >= 0);
if (type_limit > 0 && hard_limit > 0) if (type_limit > 0 && hard_limit > 0)
{ {
t->set_announce_to_dht(--dht_limit >= 0);
t->set_announce_to_trackers(--tracker_limit >= 0);
t->set_announce_to_lsd(--lsd_limit >= 0);
--hard_limit; --hard_limit;
--type_limit; --type_limit;
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
@ -3602,6 +3599,9 @@ retry:
#endif #endif
// use graceful pause for auto-managed torrents // use graceful pause for auto-managed torrents
t->set_allow_peers(false, true); t->set_allow_peers(false, true);
t->set_announce_to_dht(false);
t->set_announce_to_trackers(false);
t->set_announce_to_lsd(false);
} }
} }
} }