allow negative and zero values for session_settings::connection_speed
This commit is contained in:
parent
752149e341
commit
c9b53ddf8c
|
@ -2676,7 +2676,8 @@ connection may delay the connection of other peers considerably.</p>
|
|||
<p><tt class="docutils literal"><span class="pre">ignore_limits_on_local_network</span></tt>, if set to true, upload, download and
|
||||
unchoke limits are ignored for peers on the local network.</p>
|
||||
<p><tt class="docutils literal"><span class="pre">connection_speed</span></tt> is the number of connection attempts that
|
||||
are made per second.</p>
|
||||
are made per second. If a number <= 0 is specified, it will default to
|
||||
200 connections per second.</p>
|
||||
<p><tt class="docutils literal"><span class="pre">send_redundant_have</span></tt> controls if have messages will be sent
|
||||
to peers that already have the piece. This is typically not necessary,
|
||||
but it might be necessary for collecting statistics in some cases.
|
||||
|
|
|
@ -2684,7 +2684,8 @@ connection may delay the connection of other peers considerably.
|
|||
unchoke limits are ignored for peers on the local network.
|
||||
|
||||
``connection_speed`` is the number of connection attempts that
|
||||
are made per second.
|
||||
are made per second. If a number <= 0 is specified, it will default to
|
||||
200 connections per second.
|
||||
|
||||
``send_redundant_have`` controls if have messages will be sent
|
||||
to peers that already have the piece. This is typically not necessary,
|
||||
|
|
|
@ -804,7 +804,6 @@ namespace detail
|
|||
|
||||
INVARIANT_CHECK;
|
||||
|
||||
TORRENT_ASSERT(s.connection_speed > 0);
|
||||
TORRENT_ASSERT(s.file_pool_size > 0);
|
||||
|
||||
// less than 5 seconds unchoke interval is insane
|
||||
|
@ -814,6 +813,8 @@ namespace detail
|
|||
if (m_settings.cache_expiry != s.cache_expiry)
|
||||
m_disk_thread.set_cache_size(s.cache_expiry);
|
||||
m_settings = s;
|
||||
if (m_settings.connection_speed <= 0) m_settings.connection_speed = 200;
|
||||
|
||||
m_files.resize(m_settings.file_pool_size);
|
||||
if (!s.auto_upload_slots) m_allowed_upload_slots = m_max_uploads;
|
||||
// replace all occurances of '\n' with ' '.
|
||||
|
|
Loading…
Reference in New Issue