Changeset 12335


Ignore:
Timestamp:
Apr 7, 2011, 8:15:49 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) in peer-mgr's closeBadPeers() function, don't bother doing any of the setup/teardown calculations if the peer array is empty.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r12328 r12335  
    33213321closeBadPeers( Torrent * t, const time_t now_sec )
    33223322{
    3323     int i;
    3324     int peerCount;
    3325     struct tr_peer ** peers = getPeersToClose( t, now_sec, &peerCount );
    3326     for( i=0; i<peerCount; ++i )
    3327         closePeer( t, peers[i] );
    3328     tr_free( peers );
     3323    if( !tr_ptrArrayEmpty( &t->peers ) )
     3324    {
     3325        int i;
     3326        int peerCount;
     3327        struct tr_peer ** peers = getPeersToClose( t, now_sec, &peerCount );
     3328        for( i=0; i<peerCount; ++i )
     3329            closePeer( t, peers[i] );
     3330        tr_free( peers );
     3331    }
    33293332}
    33303333
Note: See TracChangeset for help on using the changeset viewer.