Changeset 7646
- Timestamp:
- Jan 9, 2009, 3:45:44 PM (12 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r7626 r7646 67 67 * this throttle is to avoid overloading the router */ 68 68 MAX_CONNECTIONS_PER_SECOND = 32, 69 70 /* number of unchoked peers per torrent.71 * FIXME: this probably ought to be configurable */72 MAX_UNCHOKED_PEERS = 14,73 69 74 70 /* number of bad pieces a peer is allowed to send before we ban them */ … … 1933 1929 tr_peer ** peers = (tr_peer**) tr_ptrArrayBase( &t->peers ); 1934 1930 struct ChokeData * choke = tr_new0( struct ChokeData, peerCount ); 1931 const tr_session * session = t->manager->session; 1935 1932 const int chokeAll = !tr_torrentIsPieceTransferAllowed( t->tor, TR_CLIENT_TO_PEER ); 1936 1933 const uint64_t now = tr_date( ); … … 1982 1979 */ 1983 1980 unchokedInterested = 0; 1984 for( i=0; i<size && unchokedInterested< MAX_UNCHOKED_PEERS; ++i ) {1981 for( i=0; i<size && unchokedInterested<session->uploadSlotsPerTorrent; ++i ) { 1985 1982 choke[i].doUnchoke = 1; 1986 1983 if( choke[i].isInterested ) -
trunk/libtransmission/session.c
r7643 r7646 254 254 tr_bencDictAddInt( d, TR_PREFS_KEY_USPEED, 100 ); 255 255 tr_bencDictAddInt( d, TR_PREFS_KEY_USPEED_ENABLED, 0 ); 256 tr_bencDictAddInt( d, TR_PREFS_KEY_UPLOAD_SLOTS_PER_TORRENT, 14 ); 256 257 } 257 258 … … 298 299 tr_bencDictAddInt( d, TR_PREFS_KEY_USPEED, tr_sessionGetSpeedLimit( s, TR_UP ) ); 299 300 tr_bencDictAddInt( d, TR_PREFS_KEY_USPEED_ENABLED, tr_sessionIsSpeedLimitEnabled( s, TR_UP ) ); 301 tr_bencDictAddInt( d, TR_PREFS_KEY_UPLOAD_SLOTS_PER_TORRENT, s->uploadSlotsPerTorrent ); 300 302 301 303 for( i=0; i<n; ++i ) … … 493 495 /** 494 496 **/ 497 498 found = tr_bencDictFindInt( &settings, TR_PREFS_KEY_UPLOAD_SLOTS_PER_TORRENT, &i ); 499 assert( found ); 500 session->uploadSlotsPerTorrent = i; 495 501 496 502 found = tr_bencDictFindInt( &settings, TR_PREFS_KEY_USPEED, &i ) -
trunk/libtransmission/session.h
r7643 r7646 77 77 uint16_t openFileLimit; 78 78 79 int uploadSlotsPerTorrent; 80 79 81 tr_port peerPort; 80 82 tr_port randomPortLow; -
trunk/libtransmission/transmission.h
r7643 r7646 156 156 #define TR_PREFS_KEY_USPEED_ENABLED "upload-limit-enabled" 157 157 #define TR_PREFS_KEY_USPEED "upload-limit" 158 #define TR_PREFS_KEY_UPLOAD_SLOTS_PER_TORRENT "upload-slots-per-torrent" 158 159 159 160 struct tr_benc;
Note: See TracChangeset
for help on using the changeset viewer.