diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-11-03 06:49:02 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-11-03 06:49:02 +0000 |
| commit | 7cf589e78483e6ca7daff2ddd1a30af8091a4448 (patch) | |
| tree | d595de6899aa7ddad9ad6242c9f50dd6c2a85e22 /src/UTPexExtensionMessage.cc | |
| parent | 93edc7bd202df92174cc4ce3b8c0c0c7684170fd (diff) | |
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made BtRegistry non-static object. Now DownloadEngine has a
reference to its object.
* src/AbstractBtMessage.cc
* src/ActivePeerConnectionCommand.cc
* src/ActivePeerConnectionCommand.h
* src/BtContextAwareCommand.cc
* src/BtContextAwareCommand.h
* src/BtExtendedMessage.cc
* src/BtExtendedMessage.h
* src/BtInterestedMessage.cc
* src/BtInterestedMessage.h
* src/BtNotInterestedMessage.cc
* src/BtNotInterestedMessage.h
* src/BtRegistry.cc
* src/BtRegistry.h
* src/BtSeederStateChoke.cc
* src/BtSetup.cc
* src/DHTGetPeersCommand.cc
* src/DHTGetPeersCommand.h
* src/DHTPeerAnnounceEntry.cc
* src/DHTPeerAnnounceEntry.h
* src/DHTPeerAnnounceStorage.cc
* src/DHTPeerAnnounceStorage.h
* src/DHTPeerLookupTask.cc
* src/DHTPeerLookupTask.h
* src/DHTSetup.cc
* src/DHTSetup.h
* src/DHTTaskFactory.h
* src/DHTTaskFactoryImpl.cc
* src/DHTTaskFactoryImpl.h
* src/DefaultBtAnnounce.cc
* src/DefaultBtInteractive.cc
* src/DefaultBtInteractive.h
* src/DefaultBtMessageDispatcher.cc
* src/DefaultBtMessageDispatcher.h
* src/DefaultBtMessageFactory.cc
* src/DefaultBtMessageFactory.h
* src/DefaultBtMessageReceiver.cc
* src/DefaultBtProgressInfoFile.cc
* src/DefaultBtProgressInfoFile.h
* src/DefaultBtRequestFactory.cc
* src/DefaultBtRequestFactory.h
* src/DefaultExtensionMessageFactory.cc
* src/DefaultExtensionMessageFactory.h
* src/DefaultPeerStorage.cc
* src/DefaultPeerStorage.h
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/InitiatorMSEHandshakeCommand.cc
* src/InitiatorMSEHandshakeCommand.h
* src/MSEHandshake.cc
* src/MSEHandshake.h
* src/Makefile.am
* src/Makefile.in
* src/PeerChokeCommand.cc
* src/PeerChokeCommand.h
* src/PeerInitiateConnectionCommand.cc
* src/PeerInitiateConnectionCommand.h
* src/PeerInteractionCommand.cc
* src/PeerInteractionCommand.h
* src/PeerObject.h
* src/PeerReceiveHandshakeCommand.cc
* src/PeerReceiveHandshakeCommand.h
* src/ReceiverMSEHandshakeCommand.cc
* src/RequestGroup.cc
* src/RequestGroup.h
* src/RequestGroupMan.cc
* src/RequestGroupMan.h
* src/SeedCheckCommand.cc
* src/SeedCheckCommand.h
* src/ShareRatioSeedCriteria.h
* src/SimpleBtMessage.cc
* src/TrackerWatcherCommand.cc
* src/TrackerWatcherCommand.h
* src/UTPexExtensionMessage.cc
* src/UTPexExtensionMessage.h
* test/BtCancelMessageTest.cc
* test/BtChokeMessageTest.cc
* test/BtExtendedMessageTest.cc
* test/BtInterestedMessageTest.cc
* test/BtNotInterestedMessageTest.cc
* test/BtPieceMessageTest.cc
* test/BtPortMessageTest.cc
* test/BtRegistryTest.cc
* test/BtRejectMessageTest.cc
* test/BtRequestMessageTest.cc
* test/DHTPeerAnnounceEntryTest.cc
* test/DHTPeerAnnounceStorageTest.cc
* test/DefaultBtMessageDispatcherTest.cc
* test/DefaultBtMessageFactoryTest.cc
* test/DefaultBtProgressInfoFileTest.cc
* test/DefaultBtRequestFactoryTest.cc
* test/DefaultExtensionMessageFactoryTest.cc
* test/MSEHandshakeTest.cc
* test/MockDHTTaskFactory.h
* test/ShareRatioSeedCriteriaTest.cc
* test/UTPexExtensionMessageTest.cc
Diffstat (limited to 'src/UTPexExtensionMessage.cc')
| -rw-r--r-- | src/UTPexExtensionMessage.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/UTPexExtensionMessage.cc b/src/UTPexExtensionMessage.cc index fb7bfd7b..892483b1 100644 --- a/src/UTPexExtensionMessage.cc +++ b/src/UTPexExtensionMessage.cc @@ -34,13 +34,11 @@ /* copyright --> */ #include "UTPexExtensionMessage.h" #include "Peer.h" -#include "BtContext.h" #include "Dictionary.h" #include "Data.h" #include "BencodeVisitor.h" #include "Util.h" #include "PeerMessageUtil.h" -#include "BtRegistry.h" #include "PeerStorage.h" #include "CompactPeerListProcessor.h" #include "MetaFileUtil.h" @@ -96,7 +94,7 @@ std::string UTPexExtensionMessage::toString() const void UTPexExtensionMessage::doReceivedAction() { - PEER_STORAGE(_btContext)->addPeer(_freshPeers); + _peerStorage->addPeer(_freshPeers); } bool UTPexExtensionMessage::addFreshPeer(const PeerHandle& peer) @@ -161,14 +159,14 @@ size_t UTPexExtensionMessage::getMaxDroppedPeer() const return _maxDroppedPeer; } -void UTPexExtensionMessage::setBtContext(const BtContextHandle& btContext) +void UTPexExtensionMessage::setPeerStorage +(const SharedHandle<PeerStorage>& peerStorage) { - _btContext = btContext; + _peerStorage = peerStorage; } UTPexExtensionMessageHandle -UTPexExtensionMessage::create(const BtContextHandle& btContext, - const unsigned char* data, size_t len) +UTPexExtensionMessage::create(const unsigned char* data, size_t len) { if(len < 1) { throw DlAbortEx(StringFormat(MSG_TOO_SMALL_PAYLOAD_SIZE, |
