Changeset 3262


Ignore:
Timestamp:
Oct 1, 2007, 5:51:07 PM (15 years ago)
Author:
charles
Message:

throttle back how many concurrent connections we make.

File:
1 edited

Legend:

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

    r3261 r3262  
    6363    MAX_CONNECTED_PEERS_PER_TORRENT = 60,
    6464
     65    MAX_RECONNECTIONS_PER_MINUTE = MAX_CONNECTED_PEERS_PER_TORRENT,
     66    MAX_RECONNECTIONS_PER_PULSE = ((MAX_RECONNECTIONS_PER_MINUTE * RECONNECT_PERIOD_MSEC) / (60*1000)),
    6567
    6668    ADDED_F_ENCRYPTION_FLAG = 1,
     
    16341636        const int peerCount = tr_ptrArraySize( t->peers );
    16351637
    1636         fprintf( stderr, "RECONNECT pulse for [%s]: %d weak connections, %d connection candidates, %d atoms\n",
    1637                  t->tor->info.name, nConnections, nCandidates, tr_ptrArraySize(t->pool) );
     1638        fprintf( stderr, "RECONNECT pulse for [%s]: %d weak connections, %d connection candidates, %d atoms, max per pulse is %d\n",
     1639                 t->tor->info.name, nConnections, nCandidates, tr_ptrArraySize(t->pool), (int)MAX_RECONNECTIONS_PER_PULSE );
    16381640
    16391641        for( i=0; i<nConnections; ++i )
     
    16521654        /* add some new ones */
    16531655        nAdd = MAX_CONNECTED_PEERS_PER_TORRENT - peerCount;
    1654         for( i=0; i<nAdd && i<nCandidates; ++i ) {
     1656        for( i=0; i<nAdd && i<nCandidates && i<MAX_RECONNECTIONS_PER_PULSE; ++i ) {
    16551657            struct peer_atom * atom = candidates[i];
    16561658            tr_peerIo * io = tr_peerIoNewOutgoing( t->manager->handle, &atom->addr, atom->port, t->hash );
Note: See TracChangeset for help on using the changeset viewer.