mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk libT) minor torrent iteration cleanup. (wereHamster, charles)
This commit is contained in:
@@ -165,8 +165,7 @@ bindCb( int * const socket,
|
||||
static void
|
||||
incomingPeersPulse( tr_shared * s )
|
||||
{
|
||||
int allPaused;
|
||||
tr_torrent * tor;
|
||||
tr_bool allPaused;
|
||||
|
||||
if( s->shouldChange )
|
||||
{
|
||||
@@ -176,17 +175,7 @@ incomingPeersPulse( tr_shared * s )
|
||||
tr_socketListForEach( s->bindSockets, &bindCb, s );
|
||||
}
|
||||
|
||||
/* see if any torrents aren't paused */
|
||||
allPaused = 1;
|
||||
tor = NULL;
|
||||
while( ( tor = tr_torrentNext( s->session, tor ) ) )
|
||||
{
|
||||
if( TR_STATUS_IS_ACTIVE( tr_torrentGetActivity( tor ) ) )
|
||||
{
|
||||
allPaused = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
allPaused = tr_sessionGetActiveTorrentCount( s->session ) == 0;
|
||||
|
||||
/* if we have any running torrents, check for new incoming peer connections */
|
||||
/* (jhujhiti):
|
||||
|
||||
@@ -936,7 +936,8 @@ trackerPulse( void * vsession )
|
||||
dbgmsg( NULL, "tracker pulse... %d running", th->runningCount );
|
||||
|
||||
/* upkeep: queue periodic rescrape / reannounce */
|
||||
for( tor = session->torrentList; tor; tor = tor->next )
|
||||
tor = NULL;
|
||||
while(( tor = tr_torrentNext( session, tor )))
|
||||
{
|
||||
tr_tracker * t = tor->tracker;
|
||||
|
||||
@@ -965,7 +966,7 @@ trackerPulse( void * vsession )
|
||||
/* free the tracker manager if no torrents are left */
|
||||
if( ( session->tracker )
|
||||
&& ( session->tracker->runningCount < 1 )
|
||||
&& ( session->torrentList == NULL ) )
|
||||
&& ( tr_sessionCountTorrents( session ) == 0 ) )
|
||||
{
|
||||
tr_trackerSessionClose( session );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user