|
|
@ -550,9 +550,18 @@ void clean_all_torrents( void ) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* If nothing to be cleaned here, handle next torrent */
|
|
|
|
/* If nothing to be cleaned here, handle next torrent */
|
|
|
|
if( timedout > OT_POOLS_COUNT )
|
|
|
|
if( timedout > OT_POOLS_COUNT ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
peers_count = 0;
|
|
|
|
|
|
|
|
for( k = 0; k < OT_POOLS_COUNT; ++k )
|
|
|
|
|
|
|
|
peers_count += peer_list->peers[k].size;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( !peers_count )
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timedout = OT_POOLS_COUNT;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Release vectors that have timed out */
|
|
|
|
/* Release vectors that have timed out */
|
|
|
|
for( k = OT_POOLS_COUNT - timedout; k < OT_POOLS_COUNT; ++k )
|
|
|
|
for( k = OT_POOLS_COUNT - timedout; k < OT_POOLS_COUNT; ++k )
|
|
|
|
free( peer_list->peers[k].data);
|
|
|
|
free( peer_list->peers[k].data);
|
|
|
|