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
pull/1/head
Tatsuhiro Tsujikawa 2009-11-22 15:16:12 +00:00
parent c73d235ab8
commit 9d2199acbb
2 changed files with 15 additions and 2 deletions

View File

@ -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> 2009-11-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added BitTorrent magnet link support to ProtocolDetector. Added BitTorrent magnet link support to ProtocolDetector.

View File

@ -48,6 +48,7 @@
#include "BtAnnounce.h" #include "BtAnnounce.h"
#include "RequestGroup.h" #include "RequestGroup.h"
#include "DownloadContext.h" #include "DownloadContext.h"
#include "bittorrent_helper.h"
namespace aria2 { namespace aria2 {
@ -81,8 +82,14 @@ bool ActivePeerConnectionCommand::execute() {
const unsigned int maxDownloadLimit = const unsigned int maxDownloadLimit =
_requestGroup->getMaxDownloadSpeedLimit(); _requestGroup->getMaxDownloadSpeedLimit();
const unsigned int maxUploadLimit = _requestGroup->getMaxUploadSpeedLimit(); const unsigned int maxUploadLimit = _requestGroup->getMaxUploadSpeedLimit();
unsigned int thresholdSpeed = unsigned int thresholdSpeed;
_requestGroup->getOption()->getAsInt(PREF_BT_REQUEST_PEER_SPEED_LIMIT); 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) { if(maxDownloadLimit > 0) {
thresholdSpeed = std::min(maxDownloadLimit, thresholdSpeed); thresholdSpeed = std::min(maxDownloadLimit, thresholdSpeed);
} }