fixed so that peers only get one fast-reconnect

This commit is contained in:
Marcos Pinto 2007-10-12 01:30:10 +00:00
parent 370578119e
commit 734fa157b4
3 changed files with 10 additions and 1 deletions

View File

@ -176,7 +176,13 @@ namespace libtorrent
void set_non_prioritized(bool b)
{ m_non_prioritized = b; }
void fast_reconnect(bool r) { m_fast_reconnect = r; }
void fast_reconnect(bool r)
{
if (peer_info_struct() && peer_info_struct()->fast_reconnects > 0) return;
m_fast_reconnect = r;
if (peer_info_struct()) ++peer_info_struct()->fast_reconnects;
}
bool fast_reconnect() const { return m_fast_reconnect; }
// this adds an announcement in the announcement queue

View File

@ -156,6 +156,8 @@ namespace libtorrent
// this is true if the peer is a seed
bool seed;
int fast_reconnects;
// true if this peer currently is unchoked
// because of an optimistic unchoke.
// when the optimistic unchoke is moved to

View File

@ -1503,6 +1503,7 @@ namespace libtorrent
, failcount(0)
, hashfails(0)
, seed(false)
, fast_reconnects(0)
, optimistically_unchoked(false)
, last_optimistically_unchoked(min_time())
, connected(min_time())