fast reconnect fixes

This commit is contained in:
Arvid Norberg
2007-10-15 05:03:29 +00:00
parent 282edb5861
commit 1699fa4652
6 changed files with 18 additions and 16 deletions

View File

@@ -394,6 +394,16 @@ namespace libtorrent
#endif
}
void peer_connection::fast_reconnect(bool r)
{
if (peer_info_struct() && peer_info_struct()->fast_reconnects > 1) return;
m_fast_reconnect = r;
peer_info_struct()->connected = time_now()
- seconds(m_ses.settings().min_reconnect_time
* m_ses.settings().max_failcount);
if (peer_info_struct()) ++peer_info_struct()->fast_reconnects;
}
void peer_connection::announce_piece(int index)
{
// dont announce during handshake
@@ -1922,7 +1932,6 @@ namespace libtorrent
void peer_connection::timed_out()
{
if (m_peer_info) ++m_peer_info->failcount;
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
(*m_ses.m_logger) << "CONNECTION TIMED OUT: " << m_remote.address().to_string()
<< "\n";