more asserts to try to catch crash in disconnect_peers

This commit is contained in:
Arvid Norberg 2010-03-08 01:54:56 +00:00
parent d73cf769f1
commit d18b1612e4
1 changed files with 7 additions and 0 deletions

View File

@ -4422,7 +4422,12 @@ namespace libtorrent
peer_connection* p = *i;
++ret;
TORRENT_ASSERT(p->associated_torrent().lock().get() == this);
#ifdef TORRENT_DEBUG
int num_conns = m_connections.size();
#endif
p->disconnect(errors::optimistic_disconnect);
TORRENT_ASSERT(m_connections.size() == num_conns - 1);
}
return ret;
@ -5101,6 +5106,8 @@ namespace libtorrent
int scale = 100;
if (!is_seed()) scale = 50;
if (num == 0) return 0;
int ret = 0;
ptime now = time_now();