summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-11-22 15:16:12 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-11-22 15:16:12 +0000
commit9d2199acbb500ab5b9b53d941d64cdeaabdef08d (patch)
tree4987a9929de835ae4768cd93ab4cd4946fd16052
parentc73d235ab87d2c73d9bcce9f581311862e7dc029 (diff)
2009-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Set thresholdSpeed to 0 in metadataGetMode because speed doesn't get high enough in that mode. * src/ActivePeerConnectionCommand.cc
-rw-r--r--ChangeLog6
-rw-r--r--src/ActivePeerConnectionCommand.cc11
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 93c5d744..45b0d7ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
+
+ Set thresholdSpeed to 0 in metadataGetMode because speed doesn't
+ get high enough in that mode.
+ * src/ActivePeerConnectionCommand.cc
+
2009-11-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added BitTorrent magnet link support to ProtocolDetector.
diff --git a/src/ActivePeerConnectionCommand.cc b/src/ActivePeerConnectionCommand.cc
index 7f5709d8..24ec1efd 100644
--- a/src/ActivePeerConnectionCommand.cc
+++ b/src/ActivePeerConnectionCommand.cc
@@ -48,6 +48,7 @@
#include "BtAnnounce.h"
#include "RequestGroup.h"
#include "DownloadContext.h"
+#include "bittorrent_helper.h"
namespace aria2 {
@@ -81,8 +82,14 @@ bool ActivePeerConnectionCommand::execute() {
const unsigned int maxDownloadLimit =
_requestGroup->getMaxDownloadSpeedLimit();
const unsigned int maxUploadLimit = _requestGroup->getMaxUploadSpeedLimit();
- unsigned int thresholdSpeed =
- _requestGroup->getOption()->getAsInt(PREF_BT_REQUEST_PEER_SPEED_LIMIT);
+ unsigned int thresholdSpeed;
+ if(_requestGroup->getDownloadContext()->
+ getAttribute(bittorrent::BITTORRENT).containsKey(bittorrent::METADATA)) {
+ thresholdSpeed =
+ _requestGroup->getOption()->getAsInt(PREF_BT_REQUEST_PEER_SPEED_LIMIT);
+ } else {
+ thresholdSpeed = 0;
+ }
if(maxDownloadLimit > 0) {
thresholdSpeed = std::min(maxDownloadLimit, thresholdSpeed);
}