diff --git a/ChangeLog b/ChangeLog index 93c5982b..742d7b47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-06-13 Tatsuhiro Tsujikawa + + Reverted changes which deleted peerConnection from + DefaultBtInteractive. + * src/DefaultBtInteractive.cc + * src/DefaultBtInteractive.h + * src/PeerInteractionCommand.cc + 2010-06-13 Tatsuhiro Tsujikawa Rewritten DHTRegistry diff --git a/src/DefaultBtInteractive.cc b/src/DefaultBtInteractive.cc index 6d042573..6d21813b 100644 --- a/src/DefaultBtInteractive.cc +++ b/src/DefaultBtInteractive.cc @@ -63,6 +63,7 @@ #include "BtMessageDispatcher.h" #include "BtMessageFactory.h" #include "BtRequestFactory.h" +#include "PeerConnection.h" #include "Logger.h" #include "LogFactory.h" #include "StringFormat.h" @@ -625,6 +626,12 @@ void DefaultBtInteractive::setBtRequestFactory _btRequestFactory = factory; } +void DefaultBtInteractive::setPeerConnection +(const SharedHandle& peerConnection) +{ + _peerConnection = peerConnection; +} + void DefaultBtInteractive::setExtensionMessageFactory (const SharedHandle& factory) { diff --git a/src/DefaultBtInteractive.h b/src/DefaultBtInteractive.h index 0b186133..7d982dc8 100644 --- a/src/DefaultBtInteractive.h +++ b/src/DefaultBtInteractive.h @@ -54,6 +54,7 @@ class BtMessageReceiver; class BtMessageDispatcher; class BtMessageFactory; class BtRequestFactory; +class PeerConnection; class ExtensionMessageFactory; class ExtensionMessageRegistry; class DHTNode; @@ -112,6 +113,9 @@ private: SharedHandle _btMessageReceiver; SharedHandle _dispatcher; SharedHandle _btRequestFactory; + // Although _peerStorage is not used in this class, this object + // holds the reference so that _peerConnection is not deleted. + SharedHandle _peerConnection; SharedHandle _messageFactory; SharedHandle _extensionMessageFactory; SharedHandle _extensionMessageRegistry; @@ -206,6 +210,8 @@ public: void setBtRequestFactory(const SharedHandle& factory); + void setPeerConnection(const SharedHandle& peerConnection); + void setBtMessageFactory(const SharedHandle& factory); void setExtensionMessageFactory diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc index 468c5c98..ffbe74f5 100644 --- a/src/PeerInteractionCommand.cc +++ b/src/PeerInteractionCommand.cc @@ -182,6 +182,7 @@ PeerInteractionCommand::PeerInteractionCommand btInteractive->setBtMessageReceiver(receiver); btInteractive->setDispatcher(dispatcher); btInteractive->setBtRequestFactory(reqFactory); + btInteractive->setPeerConnection(peerConnection); btInteractive->setExtensionMessageFactory(extensionMessageFactory); btInteractive->setExtensionMessageRegistry(exMsgRegistry); btInteractive->setKeepAliveInterval