From 04cd6fb67bb9ab1ceb7e5fc9959e0ef823ca9ca2 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 13 Jun 2007 16:21:59 +0000 Subject: [PATCH] libtorrent 'endpoint not connected' exception fix --- libtorrent/src/session_impl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libtorrent/src/session_impl.cpp b/libtorrent/src/session_impl.cpp index 3c16a53a7..9244255bc 100755 --- a/libtorrent/src/session_impl.cpp +++ b/libtorrent/src/session_impl.cpp @@ -599,8 +599,14 @@ namespace libtorrent { namespace detail for (session_impl::connection_map::iterator i = m_connections.begin(); i != m_connections.end();) { - tcp::endpoint sender = i->first->remote_endpoint(); - if (m_ip_filter.access(sender.address()) & ip_filter::blocked) + tcp::endpoint sender; + try { + sender = i->first->remote_endpoint(); + } catch (asio::system_error& e) { + i++; + continue; + } + if (m_ip_filter.access(sender.address()) & ip_filter::blocked) { #if defined(TORRENT_VERBOSE_LOGGING) (*i->second->m_logger) << "*** CONNECTION FILTERED\n";