forked from premiere/premiere-libtorrent
made the upload slot setting be a minimum for the rate based auto unchoke algorithm
This commit is contained in:
parent
20d3c46155
commit
c9a789d86f
|
@ -3709,9 +3709,9 @@ less than what has been set by ``session::set_max_uploads()``. To query the
|
||||||
current number of upload slots, see ``session_status::allowed_upload_slots``.
|
current number of upload slots, see ``session_status::allowed_upload_slots``.
|
||||||
|
|
||||||
When ``auto_upload_slots_rate_based`` is set, and ``auto_upload_slots`` is set,
|
When ``auto_upload_slots_rate_based`` is set, and ``auto_upload_slots`` is set,
|
||||||
the max upload slots setting is ignored and decided completely automatically.
|
the max upload slots setting is used as a minimum number of unchoked slots.
|
||||||
This algorithm is designed to prevent the peer from spreading its upload
|
This algorithm is designed to prevent the peer from spreading its upload
|
||||||
capacity too thin.
|
capacity too thin, but still open more slots in order to utilize the full capacity.
|
||||||
|
|
||||||
``use_parole_mode`` specifies if parole mode should be used. Parole mode means
|
``use_parole_mode`` specifies if parole mode should be used. Parole mode means
|
||||||
that peers that participate in pieces that fail the hash check are put in a mode
|
that peers that participate in pieces that fail the hash check are put in a mode
|
||||||
|
|
|
@ -1856,7 +1856,7 @@ namespace aux {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the client is configured to use fully automatic
|
// if the client is configured to use fully automatic
|
||||||
// unchoke slots, ignore m_max_uploads
|
// unchoke slots, m_max_uploads is still a lower limit
|
||||||
if (m_settings.auto_upload_slots_rate_based
|
if (m_settings.auto_upload_slots_rate_based
|
||||||
&& m_settings.auto_upload_slots)
|
&& m_settings.auto_upload_slots)
|
||||||
{
|
{
|
||||||
|
@ -1889,7 +1889,10 @@ namespace aux {
|
||||||
int rate = p.uploaded_since_unchoke()
|
int rate = p.uploaded_since_unchoke()
|
||||||
* 1000 / total_milliseconds(unchoke_interval);
|
* 1000 / total_milliseconds(unchoke_interval);
|
||||||
|
|
||||||
if (rate < rate_threshold) break;
|
if (rate < rate_threshold
|
||||||
|
&& m_allowed_upload_slots >= m_max_uploads)
|
||||||
|
break;
|
||||||
|
|
||||||
++m_allowed_upload_slots;
|
++m_allowed_upload_slots;
|
||||||
|
|
||||||
// TODO: make configurable
|
// TODO: make configurable
|
||||||
|
|
Loading…
Reference in New Issue