Improvements to DHT, to support UDP connections.

* Changed getDhtPeerAddress() / Value() function to use const *bdNodeId.
 * Filled in getDhtPeerAddress()... to support UDP connections.
 * fixed bug in bdnode:: pong msg... wasn't checking if version existed.
 * printed out version string, as part of debug.
 * added IpAddr field to bdmanager peer search data.
 * stored IpAddr from queries... when peer found.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3604 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2010-10-04 21:37:07 +00:00
parent 26491f4b73
commit 20a49a59cf
6 changed files with 86 additions and 30 deletions

View file

@ -103,14 +103,14 @@ void UdpBitDht::removeCallback(BitDhtCallback *cb)
mBitDhtManager->removeCallback(cb);
}
int UdpBitDht::getDhtPeerAddress(bdNodeId *id, struct sockaddr_in &from)
int UdpBitDht::getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &from)
{
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
return mBitDhtManager->getDhtPeerAddress(id, from);
}
int UdpBitDht::getDhtValue(bdNodeId *id, std::string key, std::string &value)
int UdpBitDht::getDhtValue(const bdNodeId *id, std::string key, std::string &value)
{
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/

View file

@ -68,8 +68,8 @@ virtual void addCallback(BitDhtCallback *cb);
virtual void removeCallback(BitDhtCallback *cb);
/***** Get Results Details *****/
virtual int getDhtPeerAddress(bdNodeId *id, struct sockaddr_in &from);
virtual int getDhtValue(bdNodeId *id, std::string key, std::string &value);
virtual int getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &from);
virtual int getDhtValue(const bdNodeId *id, std::string key, std::string &value);
/******************* Internals *************************/
/***** Iteration / Loop Management *****/