more asserts to try to catch crash in disconnect_peers
This commit is contained in:
parent
d73cf769f1
commit
d18b1612e4
|
@ -4422,7 +4422,12 @@ namespace libtorrent
|
||||||
|
|
||||||
peer_connection* p = *i;
|
peer_connection* p = *i;
|
||||||
++ret;
|
++ret;
|
||||||
|
TORRENT_ASSERT(p->associated_torrent().lock().get() == this);
|
||||||
|
#ifdef TORRENT_DEBUG
|
||||||
|
int num_conns = m_connections.size();
|
||||||
|
#endif
|
||||||
p->disconnect(errors::optimistic_disconnect);
|
p->disconnect(errors::optimistic_disconnect);
|
||||||
|
TORRENT_ASSERT(m_connections.size() == num_conns - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -5101,6 +5106,8 @@ namespace libtorrent
|
||||||
int scale = 100;
|
int scale = 100;
|
||||||
if (!is_seed()) scale = 50;
|
if (!is_seed()) scale = 50;
|
||||||
|
|
||||||
|
if (num == 0) return 0;
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
ptime now = time_now();
|
ptime now = time_now();
|
||||||
|
|
Loading…
Reference in New Issue