fix ignore unchoke slot invariant check

This commit is contained in:
Arvid Norberg 2009-03-01 07:20:08 +00:00
parent 614dec05aa
commit 93eda7c7fa
2 changed files with 7 additions and 4 deletions

View File

@ -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; }

View File

@ -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);