1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

more work on the "router death" issue.

This commit is contained in:
Charles Kerr 2007-11-08 19:43:48 +00:00
parent f09965031e
commit 0d819bd67e

View file

@ -71,7 +71,7 @@ enum
/* set this too high and there will be a lot of churn. /* set this too high and there will be a lot of churn.
* set it too low and you'll get peers too slowly */ * set it too low and you'll get peers too slowly */
MAX_RECONNECTIONS_PER_PULSE = 10, MAX_RECONNECTIONS_PER_PULSE = 5,
/* corresponds to ut_pex's added.f flags */ /* corresponds to ut_pex's added.f flags */
ADDED_F_ENCRYPTION_FLAG = 1, ADDED_F_ENCRYPTION_FLAG = 1,
@ -1711,7 +1711,8 @@ reconnectPulse( void * vtorrent )
} }
/* add some new ones */ /* add some new ones */
nAdd = MAX_CONNECTED_PEERS_PER_TORRENT - peerCount; nAdd = !peerCount ? MAX_CONNECTED_PEERS_PER_TORRENT
: MAX_RECONNECTIONS_PER_PULSE;
for( i=0; i<nAdd && i<nCandidates && i<MAX_RECONNECTIONS_PER_PULSE; ++i ) for( i=0; i<nAdd && i<nCandidates && i<MAX_RECONNECTIONS_PER_PULSE; ++i )
{ {
tr_peerMgr * mgr = t->manager; tr_peerMgr * mgr = t->manager;