made the handshake timeout configurable and defaults to 10 seconds

This commit is contained in:
Arvid Norberg
2007-10-23 00:19:28 +00:00
parent 2662c84f01
commit f054ae7c2d
2 changed files with 10 additions and 5 deletions

View File

@@ -3000,13 +3000,12 @@ namespace libtorrent
return true;
}
// if it takes more than 5 seconds to receive
// handshake, disconnect
if (in_handshake() && d > seconds(5))
// do not stall waiting for a handshake
if (in_handshake() && d > seconds(m_ses.settings().handshake_timeout))
{
#ifdef TORRENT_VERBOSE_LOGGING
(*m_logger) << time_now_string() << " *** NO HANDSHAKE [ "
<< total_seconds(d) << " seconds ago ] ***\n";
(*m_logger) << time_now_string() << " *** NO HANDSHAKE [ waited "
<< total_seconds(d) << " seconds ] ***\n";
#endif
return true;
}