fixed bug reported by Marcos Pinto where an exception was not cought properly

This commit is contained in:
Arvid Norberg
2007-06-13 18:28:55 +00:00
parent bbaa2efcb0
commit 5efe12dde6

View File

@@ -601,7 +601,9 @@ 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 (std::exception&) { sender = i->second->remote(); }
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)