From 9b59c0507e648449838ec016edd7c5a6140c4ea7 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Mon, 29 Oct 2007 01:01:48 +0000 Subject: [PATCH] fix hang on shutdown --- libtorrent/src/session_impl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libtorrent/src/session_impl.cpp b/libtorrent/src/session_impl.cpp index 12b95562b..ea3214345 100755 --- a/libtorrent/src/session_impl.cpp +++ b/libtorrent/src/session_impl.cpp @@ -683,6 +683,9 @@ namespace detail i->sock->close(); } +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) + (*m_logger) << time_now_string() << " aborting all torrents\n"; +#endif // abort all torrents for (torrent_map::iterator i = m_torrents.begin() , end(m_torrents.end()); i != end; ++i) @@ -690,6 +693,16 @@ namespace detail i->second->abort(); } +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) + (*m_logger) << time_now_string() << " aborting all connections\n"; +#endif + // abort all connections + for (connection_map::iterator i = m_connections.begin() + , end(m_connections.end()); i != end; ++i) + { + i->second->disconnect(); + } + #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) (*m_logger) << time_now_string() << " aborting all tracker requests\n"; #endif