summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Pinto <markybob@dipconsultants.com>2007-10-29 01:01:48 +0000
committerMarcos Pinto <markybob@dipconsultants.com>2007-10-29 01:01:48 +0000
commite97817a6647dccd8e75be61272f8790ac435d9da (patch)
tree46a63099c17a17ac30ee425700a9582e3171bc6f
parent54cd279b3420e63da4f9c7150461c90286730137 (diff)
downloaddeluge-e97817a6647dccd8e75be61272f8790ac435d9da.tar.gz
deluge-e97817a6647dccd8e75be61272f8790ac435d9da.tar.bz2
deluge-e97817a6647dccd8e75be61272f8790ac435d9da.zip
fix hang on shutdown
-rwxr-xr-xlibtorrent/src/session_impl.cpp13
1 files changed, 13 insertions, 0 deletions
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)
@@ -691,6 +694,16 @@ namespace detail
}
#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
m_tracker_manager.abort_all_requests();