summaryrefslogtreecommitdiff
path: root/src/PeerReceiveHandshakeCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-08 16:41:21 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-08 16:41:21 +0000
commit4cb5468662394ddf588d2c5c5787d24c799524ab (patch)
tree49f7c078aacfc44e3eb65f333fb4f5d7c932b27d /src/PeerReceiveHandshakeCommand.cc
parent08856691b3fa306483c199a1e88ab15bcf0eea85 (diff)
2009-05-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Now RequestGroup has its own copy of Option object. This will help to give custom option for each RequestGroup. addTorrentFile command now takes options. * src/AbstractCommand.cc * src/AbstractCommand.h * src/AbstractProxyRequestCommand.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/AdaptiveURISelector.cc * src/BtCheckIntegrityEntry.cc * src/BtDependency.cc * src/BtDependency.h * src/BtFileAllocationEntry.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityEntry.cc * src/DownloadCommand.cc * src/FtpDownloadCommand.cc * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommandFactory.cc * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/Metalink2RequestGroup.cc * src/Metalink2RequestGroup.h * src/MetalinkPostDownloadHandler.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/PeerAbstractCommand.cc * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/RequestGroup.cc * src/RequestGroup.h * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/XmlRpcMethod.cc * src/XmlRpcMethod.h * src/XmlRpcMethodImpl.cc * src/download_helper.cc * src/download_helper.h * src/main.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc
Diffstat (limited to 'src/PeerReceiveHandshakeCommand.cc')
-rw-r--r--src/PeerReceiveHandshakeCommand.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/PeerReceiveHandshakeCommand.cc b/src/PeerReceiveHandshakeCommand.cc
index e5bf415a..c77dd843 100644
--- a/src/PeerReceiveHandshakeCommand.cc
+++ b/src/PeerReceiveHandshakeCommand.cc
@@ -67,10 +67,10 @@ PeerReceiveHandshakeCommand::PeerReceiveHandshakeCommand
const SharedHandle<PeerConnection>& peerConnection)
:
PeerAbstractCommand(cuid, peer, e, s),
- _peerConnection(peerConnection),
- _thresholdSpeed(e->option->getAsInt(PREF_BT_REQUEST_PEER_SPEED_LIMIT))
+ _peerConnection(peerConnection)
{
if(_peerConnection.isNull()) {
+ // TODO referring global option
_peerConnection.reset(new PeerConnection(cuid, socket, e->option));
}
}
@@ -109,9 +109,11 @@ bool PeerReceiveHandshakeCommand::executeInternal()
TransferStat tstat = btContext->getOwnerRequestGroup()->calculateStat();
const unsigned int maxDownloadLimit =
btContext->getOwnerRequestGroup()->getMaxDownloadSpeedLimit();
- unsigned int thresholdSpeed = _thresholdSpeed;
+ unsigned int thresholdSpeed =
+ btContext->getOwnerRequestGroup()->
+ getOption()->getAsInt(PREF_BT_REQUEST_PEER_SPEED_LIMIT);
if(maxDownloadLimit > 0) {
- thresholdSpeed = std::min(maxDownloadLimit, _thresholdSpeed);
+ thresholdSpeed = std::min(maxDownloadLimit, thresholdSpeed);
}
if((!pieceStorage->downloadFinished() &&