don't let incoming peer connections sneak past MAX_CONNECTED_PEERS_PER_TORRENT.

This commit is contained in:
Charles Kerr 2007-11-09 15:19:12 +00:00
parent b382628933
commit e168cf3f69
1 changed files with 4 additions and 0 deletions

View File

@ -932,6 +932,10 @@ myHandshakeDoneCB( tr_handshake * handshake,
tordbg( t, "banned peer %s tried to reconnect", tr_peerIoAddrStr(&atom->addr,atom->port) );
tr_peerIoFree( io );
}
else if( tr_ptrArraySize( t->peers ) >= MAX_CONNECTED_PEERS_PER_TORRENT )
{
tr_peerIoFree( io );
}
else
{
tr_peer * peer = getExistingPeer( t, addr );