mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-14 09:29:30 -04:00
Removed Lots of Debug, and fixed a couple of bugs.
* Increased Timeout Periods for UDP connections - this was stopping half of them from succeeding. * The other bug (Heartbeat / stream issues) has not been solved. * Fixed up initialisation of p3BitDht data. * add DropPeers() as NON-ACTIVE (this allows peers which aren't VISIBLE to still try and connect) * export AddFriends/FOF/Others to LinkMgr to allow further SSL IDs to be added to p3BitDht. * Export UDP Addresses to DhtWindow. * switch off lots of debugging. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4469 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e7049cc483
commit
cc9df9a80f
13 changed files with 370 additions and 190 deletions
libretroshare/src/dht
|
@ -27,6 +27,7 @@
|
|||
#include "dht/p3bitdht.h"
|
||||
|
||||
#include "tcponudp/udprelay.h"
|
||||
#include "tcponudp/udpstunner.h"
|
||||
#include "bitdht/bdstddht.h"
|
||||
|
||||
#include <sstream>
|
||||
|
@ -146,6 +147,53 @@ int p3BitDht::getNetFailedPeer(std::string peerId, PeerStatus &status)
|
|||
}
|
||||
#endif
|
||||
|
||||
std::string p3BitDht::getUdpAddressString()
|
||||
{
|
||||
std::ostringstream out;
|
||||
|
||||
struct sockaddr_in extAddr;
|
||||
uint8_t extStable;
|
||||
|
||||
if (mDhtStunner->externalAddr(extAddr, extStable))
|
||||
{
|
||||
out << " DhtExtAddr: " << inet_ntoa(extAddr.sin_addr);
|
||||
out << ":" << ntohs(extAddr.sin_port);
|
||||
|
||||
if (extStable)
|
||||
{
|
||||
out << " (Stable) ";
|
||||
}
|
||||
else
|
||||
{
|
||||
out << " (Unstable) ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out << " DhtExtAddr: Unknown ";
|
||||
}
|
||||
if (mProxyStunner->externalAddr(extAddr, extStable))
|
||||
{
|
||||
out << " ProxyExtAddr: " << inet_ntoa(extAddr.sin_addr);
|
||||
out << ":" << ntohs(extAddr.sin_port);
|
||||
|
||||
if (extStable)
|
||||
{
|
||||
out << " (Stable) ";
|
||||
}
|
||||
else
|
||||
{
|
||||
out << " (Unstable) ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out << " ProxyExtAddr: Unknown ";
|
||||
}
|
||||
|
||||
return out.str();
|
||||
}
|
||||
|
||||
/***********************************************************************************************
|
||||
********** External RsDHT Interface (defined in libretroshare/src/retroshare/rsdht.h) *********
|
||||
************************************************************************************************/
|
||||
|
@ -179,6 +227,8 @@ void convertDhtPeerDetailsToRsDhtNetPeer(RsDhtNetPeer &status, const DhtPeerDeta
|
|||
status.mDhtId = out.str();
|
||||
status.mRsId = details.mRsId;
|
||||
|
||||
status.mPeerType = details.mPeerType;
|
||||
|
||||
status.mDhtState = details.mDhtState;
|
||||
|
||||
status.mConnectState = details.mConnectLogic.connectState();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue