[libtorrent] ip filter
Brought to you by:
arvidn
|
From: Marcos P. <mar...@gm...> - 2007-06-13 16:17:47
|
At the time the blocklist is loaded there are cached connections that
haven't been connected yet, and we're trying to filter them, which
causes libtorrent to chuck an 'endpoint not connected' exception.
Maybe this will help?
Index: libtorrent/src/session_impl.cpp
===================================================================
--- libtorrent/src/session_impl.cpp (revision 599)
+++ libtorrent/src/session_impl.cpp (working copy)
@@ -599,7 +599,15 @@
for (session_impl::connection_map::iterator i
= m_connections.begin(); i != m_connections.end();)
{
- tcp::endpoint sender = i->first->remote_endpoint();
+ tcp::endpoint sender;
+ try {
+ sender = i->first->remote_endpoint();
+ } catch (asio::system_error& e) {
+ // May be a cached connection
+ i++;
+ continue;
+ }
+
if (m_ip_filter.access(sender.address()) &
ip_filter::blocked)
{
#if defined(TORRENT_VERBOSE_LOGGING)
|