From 93eda7c7fae45e9b2b4c92f4b570ee3c2b9d21aa Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 1 Mar 2009 07:20:08 +0000 Subject: [PATCH] fix ignore unchoke slot invariant check --- include/libtorrent/peer_connection.hpp | 3 +-- src/peer_connection.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index b2dbb4ade..2f49799c6 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -337,8 +337,7 @@ namespace libtorrent void ignore_bandwidth_limits(bool i) { m_ignore_bandwidth_limits = i; } - bool ignore_unchoke_slots() const - { return m_ignore_unchoke_slots; } + bool ignore_unchoke_slots() const; void ignore_unchoke_slots(bool i) { m_ignore_unchoke_slots = i; } diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 4fecde276..26e071860 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2697,6 +2697,12 @@ namespace libtorrent - m_statistics.total_payload_upload(); } + bool peer_connection::ignore_unchoke_slots() const + { + return m_ignore_unchoke_slots + || (m_ses.settings().ignore_limits_on_local_network && on_local_network()); + } + // defined in upnp.cpp bool is_local(address const& a); @@ -3032,8 +3038,6 @@ namespace libtorrent m_ignore_bandwidth_limits = m_ses.settings().ignore_limits_on_local_network && on_local_network(); - m_ignore_unchoke_slots = m_ses.settings().ignore_limits_on_local_network - && on_local_network(); m_statistics.second_tick(tick_interval);