mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
(trunk libT) minor torrent iteration cleanup. (wereHamster, charles)
This commit is contained in:
parent
417b7b2029
commit
f945058de0
2 changed files with 5 additions and 15 deletions
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue