applied patch from #145

This commit is contained in:
Arvid Norberg 2007-09-03 22:27:52 +00:00
parent c6b8b22679
commit 4e8d49d028
1 changed files with 23 additions and 1 deletions

View File

@ -786,8 +786,30 @@ namespace detail
return;
}
// check if we have any active torrents
// if we don't reject the connection
if (m_torrents.empty())
{
return;
}
else
{
bool has_active_torrent = false;
for (torrent_map::iterator i = m_torrents.begin()
, end(m_torrents.end()); i != end; ++i)
{
if (!i->second->is_paused())
{
has_active_torrent = true;
break;
}
}
if (!has_active_torrent)
return;
}
boost::intrusive_ptr<peer_connection> c(
new bt_peer_connection(*this, s, 0));
new bt_peer_connection(*this, s, 0));
#ifndef NDEBUG
c->m_in_constructor = false;
#endif