fixed a long standing (quite rare) bug, thanks to Massaroddel. Made the tests clean up their temporary files.

This commit is contained in:
Arvid Norberg
2006-06-24 22:30:59 +00:00
parent db4ca12c02
commit d3ba5edd6d
5 changed files with 15 additions and 3 deletions

View File

@@ -599,6 +599,8 @@ namespace libtorrent { namespace detail
}
catch (std::exception& e)
{
c->disconnect();
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
(*m_logger) << "connect failed [" << c->remote() << "]: "
<< e.what() << "\n";
@@ -750,8 +752,10 @@ namespace libtorrent { namespace detail
// has to be in the queue, waiting to be connected.
connection_queue::iterator j = std::find(
m_connection_queue.begin(), m_connection_queue.end(), p);
assert(j != m_connection_queue.end());
// if this connection was closed while being connected
// it has been removed from the connection queue and
// not yet put into the half-open queue.
if (j != m_connection_queue.end())
m_connection_queue.erase(j);
}