Changeset 7320
- Timestamp:
- Dec 8, 2008, 8:23:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-msgs.c
r7289 r7320 307 307 308 308 tr_pex * pex; 309 310 /* if the peer supports the Extension Protocol in BEP 10 and 311 supplied a reqq argument, it's stored here. otherwise the 312 value is zero and should be ignored. */ 313 int64_t reqq; 309 314 }; 310 315 … … 1145 1150 dbgmsg( msgs, "msgs->port is now %hu", msgs->info->port ); 1146 1151 } 1152 1153 /* get peer's maximum request queue size */ 1154 if( tr_bencDictFindInt( &val, "reqq", &i ) ) 1155 msgs->reqq = i; 1147 1156 1148 1157 tr_bencFree( &val ); … … 1723 1732 1724 1733 static int 1725 ratePulse( void * vpeer ) 1726 { 1727 tr_peermsgs * peer = vpeer; 1728 const double rateToClient = tr_peerGetPieceSpeed( peer->info, 1729 TR_PEER_TO_CLIENT ); 1734 ratePulse( void * vmsgs ) 1735 { 1736 tr_peermsgs * msgs = vmsgs; 1737 const double rateToClient = tr_peerGetPieceSpeed( msgs->info, TR_PEER_TO_CLIENT ); 1730 1738 const int estimatedBlocksInNext30Seconds = 1731 ( rateToClient * 30 * 1024 ) / peer->torrent->blockSize; 1732 1733 peer->minActiveRequests = 8; 1734 peer->maxActiveRequests = peer->minActiveRequests + estimatedBlocksInNext30Seconds; 1739 ( rateToClient * 30 * 1024 ) / msgs->torrent->blockSize; 1740 msgs->minActiveRequests = 8; 1741 msgs->maxActiveRequests = msgs->minActiveRequests + estimatedBlocksInNext30Seconds; 1742 if( msgs->reqq > 0 ) 1743 msgs->maxActiveRequests = MIN( msgs->maxActiveRequests, msgs->reqq ); 1735 1744 return TRUE; 1736 1745 }
Note: See TracChangeset
for help on using the changeset viewer.