forked from premiere/premiere-libtorrent
fixed semantics of rate_limit_utp to also ignore per-torrent limits
This commit is contained in:
parent
511b9137b4
commit
94ae0e433b
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
* fixed semantics of rate_limit_utp to also ignore per-torrent limits
|
||||||
* fixed piece sorting bug of deadline pieces
|
* fixed piece sorting bug of deadline pieces
|
||||||
* fixed python binding build on Mac OS and BSD
|
* fixed python binding build on Mac OS and BSD
|
||||||
* fixed UNC path normalization (on windows, unless UNC paths are disabled)
|
* fixed UNC path normalization (on windows, unless UNC paths are disabled)
|
||||||
|
|
|
@ -4746,15 +4746,16 @@ namespace libtorrent
|
||||||
&& t)
|
&& t)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (!m_ignore_bandwidth_limits)
|
bool utp = m_socket->get<utp_stream>() != 0;
|
||||||
|
bool ignore_limits = m_ignore_bandwidth_limits
|
||||||
|
|| (!m_ses.m_settings.rate_limit_utp && utp);
|
||||||
|
if (!ignore_limits)
|
||||||
{
|
{
|
||||||
bool utp = m_socket->get<utp_stream>() != 0;
|
|
||||||
|
|
||||||
// in this case, we have data to send, but no
|
// in this case, we have data to send, but no
|
||||||
// bandwidth. So, we simply request bandwidth
|
// bandwidth. So, we simply request bandwidth
|
||||||
// from the bandwidth manager
|
// from the bandwidth manager
|
||||||
ret = request_upload_bandwidth(
|
ret = request_upload_bandwidth(
|
||||||
(m_ses.m_settings.rate_limit_utp || !utp) ? &m_ses.m_upload_channel : 0
|
&m_ses.m_upload_channel
|
||||||
, &t->m_bandwidth_channel[upload_channel]
|
, &t->m_bandwidth_channel[upload_channel]
|
||||||
, &m_bandwidth_channel[upload_channel]
|
, &m_bandwidth_channel[upload_channel]
|
||||||
, !utp ? &m_ses.m_tcp_upload_channel : 0);
|
, !utp ? &m_ses.m_tcp_upload_channel : 0);
|
||||||
|
@ -4899,15 +4900,16 @@ namespace libtorrent
|
||||||
&& t)
|
&& t)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (!m_ignore_bandwidth_limits)
|
bool utp = m_socket->get<utp_stream>() != 0;
|
||||||
|
bool ignore_limits = m_ignore_bandwidth_limits
|
||||||
|
|| (!m_ses.m_settings.rate_limit_utp && utp);
|
||||||
|
if (!ignore_limits)
|
||||||
{
|
{
|
||||||
bool utp = m_socket->get<utp_stream>() != 0;
|
|
||||||
|
|
||||||
// in this case, we have outstanding data to
|
// in this case, we have outstanding data to
|
||||||
// receive, but no bandwidth quota. So, we simply
|
// receive, but no bandwidth quota. So, we simply
|
||||||
// request bandwidth from the bandwidth manager
|
// request bandwidth from the bandwidth manager
|
||||||
ret = request_download_bandwidth(
|
ret = request_download_bandwidth(
|
||||||
(m_ses.m_settings.rate_limit_utp || !utp) ? &m_ses.m_download_channel : 0
|
&m_ses.m_download_channel
|
||||||
, &t->m_bandwidth_channel[download_channel]
|
, &t->m_bandwidth_channel[download_channel]
|
||||||
, &m_bandwidth_channel[download_channel]
|
, &m_bandwidth_channel[download_channel]
|
||||||
, !utp ? &m_ses.m_tcp_download_channel : 0);
|
, !utp ? &m_ses.m_tcp_download_channel : 0);
|
||||||
|
|
Loading…
Reference in New Issue