Changeset 10544


Ignore:
Timestamp:
Apr 29, 2010, 3:21:54 AM (11 years ago)
Author:
charles
Message:

(trunk libT) #2609 "Leave 5% of connection slots for incoming connections" -- implemented in trunk for 2.00

File:
1 edited

Legend:

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

    r10510 r10544  
    33443344    const time_t now = tr_time( );
    33453345    const uint64_t now_msec = tr_date( );
     3346    /* leave 5% of connection slots for incoming connections -- ticket #2609 */
     3347    const int maxCandidates = tr_sessionGetPeerLimit( session ) * 0.95;
    33463348
    33473349    /* don't start any new handshakes if we're full up */
     
    33503352    while(( tor = tr_torrentNext( session, tor )))
    33513353        n += tr_ptrArraySize( &tor->torrentPeers->peers );
    3352     if( tr_sessionGetPeerLimit( session ) <= n ) {
     3354    if( maxCandidates <= n ) {
    33533355        *candidateCount = 0;
    33543356        return NULL;
Note: See TracChangeset for help on using the changeset viewer.