diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-06-18 14:47:09 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-06-18 14:47:09 +0000 |
| commit | 8ba97188ce42be38b5427e9bd70bb7f5ba8238f9 (patch) | |
| tree | 6cba1ad1496b6865c215881e7a0f21c009287912 /src/PeerInteractionCommand.cc | |
| parent | 98dc02192d4b10eb6057a7d6a724b2e05a5767ef (diff) | |
2010-06-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Introduced ValueBase class, which is a replacement of BDE. In
this change ValueBase is used instead of BDE except DHT messages,
UTMetadata messages and XML-RPC. They'll be replaced in the later
commits. DownloadContext::_attrs is now ContextAttribute rather
than BDE.
* src/ActivePeerConnectionCommand.cc
* src/AnnounceList.cc
* src/AnnounceList.h
* src/BtDependency.cc
* src/BtRegistry.cc
* src/BtSetup.cc
* src/ConsoleStatCalc.cc
* src/ContextAttribute.h
* src/DefaultBtAnnounce.cc
* src/DefaultBtInteractive.cc
* src/DownloadContext.cc
* src/DownloadContext.h
* src/HandshakeExtensionMessage.cc
* src/InitiateConnectionCommand.cc
* src/LpdReceiveMessageCommand.cc
* src/MSEHandshake.cc
* src/Makefile.am
* src/Makefile.in
* src/PeerInteractionCommand.cc
* src/PeerListProcessor.h
* src/ProtocolDetector.cc
* src/RequestGroup.cc
* src/RequestGroupMan.cc
* src/TorrentAttribute.h
* src/TrackerWatcherCommand.cc
* src/UTMetadataDataExtensionMessage.cc
* src/UTMetadataPostDownloadHandler.cc
* src/UTMetadataRequestExtensionMessage.cc
* src/ValueBase.cc
* src/ValueBase.h
* src/XmlRpcMethodImpl.cc
* src/XmlRpcMethodImpl.h
* src/bencode2.cc
* src/bencode2.h
* src/bittorrent_helper.cc
* src/bittorrent_helper.h
* src/download_helper.cc
* src/magnet.cc
* src/magnet.h
* test/AnnounceListTest.cc
* test/Bencode2Test.cc
* test/BencodeTest.cc
* test/BittorrentHelperTest.cc
* test/BtDependencyTest.cc
* test/BtRegistryTest.cc
* test/DefaultBtAnnounceTest.cc
* test/DefaultBtProgressInfoFileTest.cc
* test/HandshakeExtensionMessageTest.cc
* test/MSEHandshakeTest.cc
* test/MagnetTest.cc
* test/Makefile.am
* test/Makefile.in
* test/RequestGroupManTest.cc
* test/UTMetadataDataExtensionMessageTest.cc
* test/UTMetadataPostDownloadHandlerTest.cc
* test/UTMetadataRequestExtensionMessageTest.cc
* test/ValueBaseTest.cc
* test/XmlRpcMethodTest.cc
Diffstat (limited to 'src/PeerInteractionCommand.cc')
| -rw-r--r-- | src/PeerInteractionCommand.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc index ffbe74f5..8fa666f6 100644 --- a/src/PeerInteractionCommand.cc +++ b/src/PeerInteractionCommand.cc @@ -102,11 +102,9 @@ PeerInteractionCommand::PeerInteractionCommand setWriteCheckSocket(getSocket()); setTimeout(getOption()->getAsInt(PREF_PEER_CONNECTION_TIMEOUT)); } - - const BDE& torrentAttrs = - _requestGroup->getDownloadContext()->getAttribute(bittorrent::BITTORRENT); - - bool metadataGetMode = !torrentAttrs.containsKey(bittorrent::METADATA); + SharedHandle<TorrentAttribute> torrentAttrs = + bittorrent::getTorrentAttrs(_requestGroup->getDownloadContext()); + bool metadataGetMode = torrentAttrs->metadata.empty(); SharedHandle<ExtensionMessageRegistry> exMsgRegistry (new ExtensionMessageRegistry()); @@ -189,7 +187,7 @@ PeerInteractionCommand::PeerInteractionCommand (getOption()->getAsInt(PREF_BT_KEEP_ALIVE_INTERVAL)); btInteractive->setRequestGroupMan(getDownloadEngine()->getRequestGroupMan()); btInteractive->setBtMessageFactory(factory); - if((metadataGetMode || torrentAttrs[bittorrent::PRIVATE].i() == 0) && + if((metadataGetMode || !torrentAttrs->privateTorrent) && !getPeer()->isLocalPeer()) { if(getOption()->getAsBool(PREF_ENABLE_PEER_EXCHANGE)) { btInteractive->setUTPexEnabled(true); |
