fix for debug iterators
This commit is contained in:
parent
4d59d9eabc
commit
00b935150a
|
@ -267,10 +267,6 @@ namespace libtorrent
|
|||
bool compare_peer(policy::peer const& lhs, policy::peer const& rhs
|
||||
, address const& external_ip) const;
|
||||
|
||||
// since the peer list can grow too large
|
||||
// to scan all of it, start at this iterator
|
||||
iterator m_round_robin;
|
||||
|
||||
iterator find_disconnect_candidate();
|
||||
iterator find_connect_candidate();
|
||||
|
||||
|
@ -278,6 +274,10 @@ namespace libtorrent
|
|||
|
||||
std::multimap<address, peer> m_peers;
|
||||
|
||||
// since the peer list can grow too large
|
||||
// to scan all of it, start at this iterator
|
||||
iterator m_round_robin;
|
||||
|
||||
torrent* m_torrent;
|
||||
|
||||
// free download we have got that hasn't
|
||||
|
|
|
@ -344,7 +344,8 @@ namespace libtorrent
|
|||
}
|
||||
|
||||
policy::policy(torrent* t)
|
||||
: m_torrent(t)
|
||||
: m_round_robin(m_peers.end())
|
||||
, m_torrent(t)
|
||||
, m_available_free_upload(0)
|
||||
, m_num_connect_candidates(0)
|
||||
{ TORRENT_ASSERT(t); }
|
||||
|
@ -484,8 +485,7 @@ namespace libtorrent
|
|||
external_ip = address_v4(bytes);
|
||||
}
|
||||
|
||||
if (m_round_robin == iterator() || m_round_robin == m_peers.end())
|
||||
m_round_robin = m_peers.begin();
|
||||
if (m_round_robin == m_peers.end()) m_round_robin = m_peers.begin();
|
||||
|
||||
for (int iterations = (std::min)(int(m_peers.size()), 300);
|
||||
iterations > 0; ++m_round_robin, --iterations)
|
||||
|
|
Loading…
Reference in New Issue