Changeset 7709


Ignore:
Timestamp:
Jan 13, 2009, 4:51:38 PM (12 years ago)
Author:
charles
Message:

(trunk libT) minor torrent iteration cleanup. (wereHamster, charles)

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/port-forwarding.c

    r7658 r7709  
    166166incomingPeersPulse( tr_shared * s )
    167167{
    168     int allPaused;
    169     tr_torrent * tor;
     168    tr_bool allPaused;
    170169   
    171170    if( s->shouldChange )
     
    177176    }
    178177   
    179     /* see if any torrents aren't paused */
    180     allPaused = 1;
    181     tor = NULL;
    182     while( ( tor = tr_torrentNext( s->session, tor ) ) )
    183     {
    184         if( TR_STATUS_IS_ACTIVE( tr_torrentGetActivity( tor ) ) )
    185         {
    186             allPaused = 0;
    187             break;
    188         }
    189     }
     178    allPaused = tr_sessionGetActiveTorrentCount( s->session ) == 0;
    190179   
    191180    /* if we have any running torrents, check for new incoming peer connections */
  • trunk/libtransmission/tracker.c

    r7658 r7709  
    937937
    938938    /* upkeep: queue periodic rescrape / reannounce */
    939     for( tor = session->torrentList; tor; tor = tor->next )
     939    tor = NULL;
     940    while(( tor = tr_torrentNext( session, tor )))
    940941    {
    941942        tr_tracker * t = tor->tracker;
     
    966967    if( ( session->tracker )
    967968      && ( session->tracker->runningCount < 1 )
    968       && ( session->torrentList == NULL ) )
     969      && ( tr_sessionCountTorrents( session ) == 0 ) )
    969970    {
    970971        tr_trackerSessionClose( session );
Note: See TracChangeset for help on using the changeset viewer.