From 36ca0eb3ba280c7feb3fbfb15050a4366869d543 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 2 Apr 2007 23:10:11 +0000 Subject: [PATCH] addition to previous peer connection download/upload limit fix --- src/peer_connection.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index eb1e176e4..56f62e8ba 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1584,16 +1584,18 @@ namespace libtorrent void peer_connection::set_upload_limit(int limit) { assert(limit >= -1); - if (limit == -1) m_upload_limit = resource_request::inf; - if (limit < 10) m_upload_limit = 10; + if (limit == -1) limit = resource_request::inf; + if (limit < 10) limit = 10; + m_upload_limit = limit; m_bandwidth_limit[upload_channel].throttle(m_upload_limit); } void peer_connection::set_download_limit(int limit) { assert(limit >= -1); - if (limit == -1) m_download_limit = resource_request::inf; - if (limit < 10) m_download_limit = 10; + if (limit == -1) limit = resource_request::inf; + if (limit < 10) limit = 10; + m_download_limit = limit; m_bandwidth_limit[download_channel].throttle(m_download_limit); }