mirror of
https://github.com/aria2/aria2.git
synced 2025-04-07 06:27:37 +03:00
2008-05-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made string literal to static const std::string * src/DHTAbstractMessage.cc * 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/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageFactoryImpl.cc * src/DHTMessageReceiver.cc * src/DHTPingMessage.cc * src/DHTPingMessage.h * src/DHTPingReplyMessage.cc * src/DHTPingReplyMessage.h * src/DHTQueryMessage.cc * src/DHTQueryMessage.h * src/DHTResponseMessage.cc * src/DHTResponseMessage.h * src/DHTUnknownMessage.cc * src/DHTUnknownMessage.h
This commit is contained in:
parent
5c8db1cc20
commit
898b807ba2
28 changed files with 207 additions and 71 deletions
|
@ -47,6 +47,10 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
const std::string DHTFindNodeReplyMessage::FIND_NODE("find_node");
|
||||
|
||||
const std::string DHTFindNodeReplyMessage::NODES("nodes");
|
||||
|
||||
DHTFindNodeReplyMessage::DHTFindNodeReplyMessage(const SharedHandle<DHTNode>& localNode,
|
||||
const SharedHandle<DHTNode>& remoteNode,
|
||||
const std::string& transactionID):
|
||||
|
@ -66,7 +70,7 @@ void DHTFindNodeReplyMessage::doReceivedAction()
|
|||
Dictionary* DHTFindNodeReplyMessage::getResponse()
|
||||
{
|
||||
Dictionary* a = new Dictionary();
|
||||
a->put("id", new Data(_localNode->getID(), DHT_ID_LENGTH));
|
||||
a->put(DHTMessage::ID, new Data(_localNode->getID(), DHT_ID_LENGTH));
|
||||
size_t offset = 0;
|
||||
unsigned char buffer[DHTBucket::K*26];
|
||||
// TODO if _closestKNodes.size() > DHTBucket::K ??
|
||||
|
@ -77,13 +81,13 @@ Dictionary* DHTFindNodeReplyMessage::getResponse()
|
|||
offset += 26;
|
||||
}
|
||||
}
|
||||
a->put("nodes", new Data(buffer, offset));
|
||||
a->put(NODES, new Data(buffer, offset));
|
||||
return a;
|
||||
}
|
||||
|
||||
std::string DHTFindNodeReplyMessage::getMessageType() const
|
||||
{
|
||||
return "find_node";
|
||||
return FIND_NODE;
|
||||
}
|
||||
|
||||
void DHTFindNodeReplyMessage::validate() const {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue