summaryrefslogtreecommitdiff
path: root/src/PeerInteractionCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-11-25 15:49:20 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-11-25 15:49:20 +0000
commit46d9f2de6373007895e84f577aa8ae413cd4e861 (patch)
tree5ab170329d937cb4fea2f04c76675062b832d0f5 /src/PeerInteractionCommand.cc
parenta26a44cb8ed28d59930bfaa4553fbd1fa7fbcb4d (diff)
2009-11-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug which causes segmentation fault with tellWaiting XML-RPC method when BitTorrent download is waiting. The key of BtRegistry is changed from info hash to GID, because it is registered per RequestGroup, not info hash. * src/BtRegistry.cc * src/BtRegistry.h * src/BtSetup.cc * src/ConsoleStatCalc.cc * src/InitiatorMSEHandshakeCommand.cc * src/PeerInitiateConnectionCommand.cc * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerReceiveHandshakeCommand.cc * src/RequestGroup.cc * src/XmlRpcMethodImpl.cc * test/BtRegistryTest.cc * test/XmlRpcMethodTest.cc
Diffstat (limited to 'src/PeerInteractionCommand.cc')
-rw-r--r--src/PeerInteractionCommand.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc
index 5cbf025f..5255fe0e 100644
--- a/src/PeerInteractionCommand.cc
+++ b/src/PeerInteractionCommand.cc
@@ -45,7 +45,6 @@
#include "Socket.h"
#include "Option.h"
#include "DownloadContext.h"
-#include "BtRegistry.h"
#include "Peer.h"
#include "BtMessage.h"
#include "BtRuntime.h"
@@ -83,6 +82,7 @@ PeerInteractionCommand::PeerInteractionCommand
DownloadEngine* e,
const SharedHandle<BtRuntime>& btRuntime,
const SharedHandle<PieceStorage>& pieceStorage,
+ const SharedHandle<PeerStorage>& peerStorage,
const SocketHandle& s,
Seq sequence,
const PeerConnectionHandle& passedPeerConnection)
@@ -90,6 +90,7 @@ PeerInteractionCommand::PeerInteractionCommand
_requestGroup(requestGroup),
_btRuntime(btRuntime),
_pieceStorage(pieceStorage),
+ _peerStorage(peerStorage),
sequence(sequence)
{
// TODO move following bunch of processing to separate method, like init()
@@ -101,9 +102,6 @@ PeerInteractionCommand::PeerInteractionCommand
const BDE& torrentAttrs =
_requestGroup->getDownloadContext()->getAttribute(bittorrent::BITTORRENT);
- SharedHandle<BtRegistry> btRegistry = e->getBtRegistry();
- SharedHandle<PeerStorage> peerStorage =
- btRegistry->get(torrentAttrs[bittorrent::INFO_HASH].s())._peerStorage;
bool metadataGetMode = !torrentAttrs.containsKey(bittorrent::METADATA);
@@ -354,12 +352,6 @@ bool PeerInteractionCommand::exitBeforeExecute()
return _btRuntime->isHalt();
}
-void PeerInteractionCommand::setPeerStorage
-(const SharedHandle<PeerStorage>& peerStorage)
-{
- _peerStorage = peerStorage;
-}
-
const SharedHandle<Option>& PeerInteractionCommand::getOption() const
{
return _requestGroup->getOption();