mirror of https://github.com/aria2/aria2
2008-08-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that the number of connected peer is exceeding the limit (55 by default) in seeding mode. Multiplied 0.8 to _maxUploadSpeedLimit. * src/ActivePeerConnectionCommand.ccpull/1/head
parent
df9d042d25
commit
a12be22ecb
|
@ -1,3 +1,10 @@
|
||||||
|
2008-08-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Fixed the bug that the number of connected peer is exceeding the limit
|
||||||
|
(55 by default) in seeding mode.
|
||||||
|
Multiplied 0.8 to _maxUploadSpeedLimit.
|
||||||
|
* src/ActivePeerConnectionCommand.cc
|
||||||
|
|
||||||
2008-08-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-08-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Clear table item.
|
Clear table item.
|
||||||
|
|
|
@ -81,11 +81,17 @@ bool ActivePeerConnectionCommand::execute() {
|
||||||
TransferStat tstat = peerStorage->calculateStat();
|
TransferStat tstat = peerStorage->calculateStat();
|
||||||
if(// for seeder state
|
if(// for seeder state
|
||||||
(pieceStorage->downloadFinished() && btRuntime->lessThanMaxPeers() &&
|
(pieceStorage->downloadFinished() && btRuntime->lessThanMaxPeers() &&
|
||||||
(_maxUploadSpeedLimit == 0 || tstat.getUploadSpeed() < _maxUploadSpeedLimit)) ||
|
(_maxUploadSpeedLimit == 0 ||
|
||||||
|
tstat.getUploadSpeed() < _maxUploadSpeedLimit*0.8)) ||
|
||||||
// for leecher state
|
// for leecher state
|
||||||
(tstat.getDownloadSpeed() < _thresholdSpeed ||
|
(!pieceStorage->downloadFinished() &&
|
||||||
btRuntime->lessThanMinPeers())) {
|
(tstat.getDownloadSpeed() < _thresholdSpeed ||
|
||||||
for(size_t numAdd = _numNewConnection;
|
btRuntime->lessThanMinPeers()))) {
|
||||||
|
size_t numConnection = pieceStorage->downloadFinished() ?
|
||||||
|
std::min(_numNewConnection,
|
||||||
|
BtRuntime::MAX_PEERS-btRuntime->getConnections()) :
|
||||||
|
_numNewConnection;
|
||||||
|
for(size_t numAdd = numConnection;
|
||||||
numAdd > 0 && peerStorage->isPeerAvailable(); --numAdd) {
|
numAdd > 0 && peerStorage->isPeerAvailable(); --numAdd) {
|
||||||
PeerHandle peer = peerStorage->getUnusedPeer();
|
PeerHandle peer = peerStorage->getUnusedPeer();
|
||||||
connectToPeer(peer);
|
connectToPeer(peer);
|
||||||
|
|
Loading…
Reference in New Issue