summaryrefslogtreecommitdiff
path: root/src/PeerReceiveHandshakeCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-28 05:07:52 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-28 05:07:52 +0000
commitdb5944b29b6dd7af58b456a56e85c3f4594e5fdd (patch)
treef12fa2d6baecd9fb654e27f3405725b0b0a77597 /src/PeerReceiveHandshakeCommand.cc
parente9e215dc1f37827fabd87d6fb7ed99afa843d53a (diff)
2008-09-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that aria2 downloads faster than max-download-limit when downloading file using both HTTP(or FTP) and BitTorrent, because aria2 evaluates speed separatly(HTTP and BiTorrent) against max-download-limit , instead of sum of them. * src/ActivePeerConnectionCommand.cc * src/DefaultBtInteractive.cc * src/DownloadCommand.cc * src/PeerInteractionCommand.cc * src/PeerReceiveHandshakeCommand.cc
Diffstat (limited to 'src/PeerReceiveHandshakeCommand.cc')
-rw-r--r--src/PeerReceiveHandshakeCommand.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/PeerReceiveHandshakeCommand.cc b/src/PeerReceiveHandshakeCommand.cc
index c6472a3e..0c8b7baa 100644
--- a/src/PeerReceiveHandshakeCommand.cc
+++ b/src/PeerReceiveHandshakeCommand.cc
@@ -53,6 +53,7 @@
#include "Option.h"
#include "RequestGroupMan.h"
#include "StringFormat.h"
+#include "RequestGroup.h"
namespace aria2 {
@@ -97,7 +98,7 @@ bool PeerReceiveHandshakeCommand::executeInternal()
throw DlAbortEx
(StringFormat("Unknown info hash %s", infoHash.c_str()).str());
}
- TransferStat tstat = PEER_STORAGE(btContext)->calculateStat();
+ TransferStat tstat = btContext->getOwnerRequestGroup()->calculateStat();
if((!PIECE_STORAGE(btContext)->downloadFinished() &&
tstat.getDownloadSpeed() < _thresholdSpeed) ||
BT_RUNTIME(btContext)->lessThanMaxPeers()) {