mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 21:47:37 +03:00
2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use BDE instead of Dictionary/List/Data. * src/DHTAbstractMessage.cc * src/DHTAbstractMessage.h * src/DHTAnnouncePeerMessage.cc * src/DHTAnnouncePeerMessage.h * src/DHTAnnouncePeerReplyMessage.cc * src/DHTAnnouncePeerReplyMessage.h * src/DHTFindNodeMessage.cc * src/DHTFindNodeMessage.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersMessage.cc * src/DHTGetPeersMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTMessageFactory.h * src/DHTMessageFactoryImpl.cc * src/DHTMessageFactoryImpl.h * src/DHTMessageReceiver.cc * src/DHTMessageTracker.cc * src/DHTMessageTracker.h * src/DHTPingMessage.cc * src/DHTPingMessage.h * src/DHTPingReplyMessage.cc * src/DHTPingReplyMessage.h * src/DHTQueryMessage.cc * src/DHTQueryMessage.h * src/DHTResponseMessage.cc * src/DHTResponseMessage.h * test/DHTAnnouncePeerMessageTest.cc * test/DHTAnnouncePeerReplyMessageTest.cc * test/DHTFindNodeMessageTest.cc * test/DHTFindNodeReplyMessageTest.cc * test/DHTGetPeersMessageTest.cc * test/DHTGetPeersReplyMessageTest.cc * test/DHTMessageFactoryImplTest.cc * test/DHTMessageTrackerTest.cc * test/DHTPingMessageTest.cc * test/DHTPingReplyMessageTest.cc * test/MockDHTMessageFactory.h
This commit is contained in:
parent
057132cd5f
commit
9202fe23c8
40 changed files with 575 additions and 510 deletions
|
@ -4,8 +4,7 @@
|
|||
#include "DHTMessageFactory.h"
|
||||
#include "DHTNode.h"
|
||||
#include "MockDHTMessage.h"
|
||||
#include "Dictionary.h"
|
||||
#include "Data.h"
|
||||
#include "bencode.h"
|
||||
|
||||
namespace aria2 {
|
||||
|
||||
|
@ -18,7 +17,7 @@ public:
|
|||
virtual ~MockDHTMessageFactory() {}
|
||||
|
||||
virtual SharedHandle<DHTMessage>
|
||||
createQueryMessage(const Dictionary* d,
|
||||
createQueryMessage(const bencode::BDE& dict,
|
||||
const std::string& ipaddr, uint16_t port)
|
||||
{
|
||||
return SharedHandle<DHTMessage>();
|
||||
|
@ -26,7 +25,7 @@ public:
|
|||
|
||||
virtual SharedHandle<DHTMessage>
|
||||
createResponseMessage(const std::string& messageType,
|
||||
const Dictionary* d,
|
||||
const bencode::BDE& dict,
|
||||
const std::string& ipaddr, uint16_t port)
|
||||
{
|
||||
SharedHandle<DHTNode> remoteNode(new DHTNode());
|
||||
|
@ -34,8 +33,7 @@ public:
|
|||
remoteNode->setIPAddress(ipaddr);
|
||||
remoteNode->setPort(port);
|
||||
SharedHandle<MockDHTMessage> m
|
||||
(new MockDHTMessage(_localNode, remoteNode,
|
||||
reinterpret_cast<const Data*>(d->get("t"))->toString()));
|
||||
(new MockDHTMessage(_localNode, remoteNode, dict["t"].s()));
|
||||
m->setReply(true);
|
||||
return m;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue