fixed semantics of rate_limit_utp to also ignore per-torrent limits

This commit is contained in:
Arvid Norberg 2012-05-06 07:09:49 +00:00
parent 511b9137b4
commit 94ae0e433b
2 changed files with 11 additions and 8 deletions

View File

@ -1,4 +1,5 @@
* fixed semantics of rate_limit_utp to also ignore per-torrent limits
* fixed piece sorting bug of deadline pieces
* fixed python binding build on Mac OS and BSD
* fixed UNC path normalization (on windows, unless UNC paths are disabled)

View File

@ -4746,15 +4746,16 @@ namespace libtorrent
&& t)
{
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)
{
// in this case, we have data to send, but no
// bandwidth. So, we simply request bandwidth
// from the bandwidth manager
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]
, &m_bandwidth_channel[upload_channel]
, !utp ? &m_ses.m_tcp_upload_channel : 0);
@ -4899,15 +4900,16 @@ namespace libtorrent
&& t)
{
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)
{
// in this case, we have outstanding data to
// receive, but no bandwidth quota. So, we simply
// request bandwidth from the bandwidth manager
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]
, &m_bandwidth_channel[download_channel]
, !utp ? &m_ses.m_tcp_download_channel : 0);