Changeset 1578


Ignore:
Timestamp:
Mar 23, 2007, 8:11:58 AM (15 years ago)
Author:
joshe
Message:

Don't add more peers from pex if we have 50 or more already.

Location:
branches/pex/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/pex/libtransmission/peer.c

    r1540 r1578  
    2626#include "peertree.h"
    2727
    28 #define MAX_REQUEST_COUNT 32
    29 #define OUR_REQUEST_COUNT 8  /* TODO: we should detect if we are on a
    30                                 high-speed network and adapt */
    31 #define PEX_INTERVAL            60
     28#define MAX_REQUEST_COUNT       32
     29#define OUR_REQUEST_COUNT       8  /* TODO: we should detect if we are on a
     30                                      high-speed network and adapt */
     31#define PEX_PEER_CUTOFF         50 /* only try to add new peers from pex if
     32                                      we have fewer existing peers than this */
     33#define PEX_INTERVAL            60 /* don't send pex messages more frequently
     34                                      than PEX_INTERVAL +
     35                                      rand( PEX_INTERVAL / 10 ) seconds */
    3236#define PEER_SUPPORTS_EXTENDED_MESSAGES( bits ) ( (bits)[5] & 0x10 )
    3337#define PEER_SUPPORTS_AZUREUS_PROTOCOL( bits )  ( (bits)[0] & 0x80 )
  • branches/pex/libtransmission/peeraz.h

    r1545 r1578  
    440440    int         ii;
    441441
    442     if( peer->private )
     442    if( peer->private || PEX_PEER_CUTOFF <= tor->peerCount )
    443443    {
    444444        return TR_OK;
  • branches/pex/libtransmission/peerext.h

    r1545 r1578  
    258258    benc_val_t val, * sub;
    259259
    260     if( peer->private )
     260    if( peer->private || PEX_PEER_CUTOFF <= tor->peerCount )
    261261    {
    262262        return TR_OK;
Note: See TracChangeset for help on using the changeset viewer.