forked from premiere/premiere-libtorrent
made the number of peers requested from trackers customizable
This commit is contained in:
parent
35b99dbae7
commit
816bf3ff2d
|
@ -106,6 +106,7 @@ namespace libtorrent
|
|||
, lazy_bitfields(true)
|
||||
, inactivity_timeout(600)
|
||||
, unchoke_interval(20)
|
||||
, num_want(200)
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
, use_dht_as_fallback(true)
|
||||
#endif
|
||||
|
@ -242,6 +243,9 @@ namespace libtorrent
|
|||
// tracker in the ip= parameter.
|
||||
address announce_ip;
|
||||
|
||||
// the num want sent to trackers
|
||||
int num_want;
|
||||
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
// while this is true, the dht will note be used unless the
|
||||
// tracker is online
|
||||
|
|
|
@ -1352,7 +1352,7 @@ namespace libtorrent
|
|||
if (m_event != tracker_request::stopped)
|
||||
m_event = tracker_request::none;
|
||||
req.url = m_trackers[m_currently_trying_tracker].url;
|
||||
req.num_want = 50;
|
||||
req.num_want = m_settings.num_want;
|
||||
// if we are aborting. we don't want any new peers
|
||||
if (req.event == tracker_request::stopped)
|
||||
req.num_want = 0;
|
||||
|
|
Loading…
Reference in New Issue