From 5dfba92665fc19ca83166c79746f7a7a12462dea Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 7 Aug 2007 07:35:21 +0000 Subject: [PATCH] fixed #101 --- src/session_impl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 8fae3bcb7..81f48a3ce 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1901,13 +1901,15 @@ namespace detail int session_impl::upload_rate_limit() const { mutex_t::scoped_lock l(m_mutex); - return m_bandwidth_manager[peer_connection::upload_channel]->throttle(); + int ret = m_bandwidth_manager[peer_connection::upload_channel]->throttle(); + return ret == std::numeric_limits::max() ? -1 : ret; } int session_impl::download_rate_limit() const { mutex_t::scoped_lock l(m_mutex); - return m_bandwidth_manager[peer_connection::download_channel]->throttle(); + int ret = m_bandwidth_manager[peer_connection::download_channel]->throttle(); + return ret == std::numeric_limits::max() ? -1 : ret; } void session_impl::start_lsd()