libtorrent 'endpoint not connected' exception fix

This commit is contained in:
Marcos Pinto 2007-06-13 16:21:59 +00:00
parent 188af2eee3
commit 04cd6fb67b
1 changed files with 8 additions and 2 deletions

View File

@ -599,7 +599,13 @@ namespace libtorrent { namespace detail
for (session_impl::connection_map::iterator i for (session_impl::connection_map::iterator i
= m_connections.begin(); i != m_connections.end();) = 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) {
i++;
continue;
}
if (m_ip_filter.access(sender.address()) & ip_filter::blocked) if (m_ip_filter.access(sender.address()) & ip_filter::blocked)
{ {
#if defined(TORRENT_VERBOSE_LOGGING) #if defined(TORRENT_VERBOSE_LOGGING)