Changeset 7239


Ignore:
Timestamp:
Dec 2, 2008, 10:25:51 PM (12 years ago)
Author:
charles
Message:

(libT) #1398: don't accept incoming peer connections when all torrents are paused

File:
1 edited

Legend:

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

    r7231 r7239  
    104104incomingPeersPulse( tr_shared * s )
    105105{
     106    int allPaused;
     107    tr_torrent * tor;
     108
    106109    if( s->bindSocket >= 0 && ( s->bindPort != s->publicPort ) )
    107110    {
     
    137140    }
    138141
    139     for( ; ; ) /* check for new incoming peer connections */
     142    /* see if any torrents aren't paused */
     143    allPaused = 1;
     144    tor = NULL;
     145    while(( tor = tr_torrentNext( s->session, tor ))) {
     146        if( TR_STATUS_IS_ACTIVE( tr_torrentGetActivity( tor ))) {
     147            allPaused = 0;
     148            break;
     149        }
     150    }
     151
     152    /* if we have any running torrents, check for new incoming peer connections */
     153    while( !allPaused ) 
    140154    {
    141155        int         socket;
Note: See TracChangeset for help on using the changeset viewer.