mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-16 18:39:46 -04:00
General debugging:
* Improved debugging messages for p3linkmgr & p3netmgr, switched on debugging. * added ids to p3bitdht peers. * added datatypes to RsDht peers data structure, and translate the data. * add const to PeerConnectStateBox::connectState(). * cleaned up p3LinkMgr::locked_ConnectAttempt_AddDynDNS() a bit. * filled in friend data types in p3LinkMgr (allows connections now!) * added printConnectState() in p3LinkMgr git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4421 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
59abce2d48
commit
b2e25680ac
8 changed files with 322 additions and 163 deletions
|
@ -185,7 +185,7 @@ void PeerConnectStateBox::stateMsg(std::ostream &out, std::string msg, uint32_t
|
|||
out << std::endl;
|
||||
}
|
||||
|
||||
std::string PeerConnectStateBox::connectState()
|
||||
std::string PeerConnectStateBox::connectState() const
|
||||
{
|
||||
std::string str = StateAsString(mState);
|
||||
std::ostringstream out;
|
||||
|
|
|
@ -85,7 +85,7 @@ class PeerConnectStateBox
|
|||
|
||||
bool shouldUseProxyPort(uint32_t netmode, uint32_t nattype);
|
||||
|
||||
std::string connectState();
|
||||
std::string connectState() const;
|
||||
|
||||
std::string mPeerId;
|
||||
|
||||
|
|
|
@ -179,6 +179,35 @@ void convertDhtPeerDetailsToRsDhtNetPeer(RsDhtNetPeer &status, const DhtPeerDeta
|
|||
status.mDhtId = out.str();
|
||||
status.mRsId = details.mRsId;
|
||||
|
||||
status.mDhtState = details.mDhtState;
|
||||
|
||||
status.mConnectState = details.mConnectLogic.connectState();
|
||||
|
||||
status.mPeerReqState = details.mPeerReqState;
|
||||
|
||||
status.mPeerConnectState = details.mPeerConnectState;
|
||||
|
||||
switch(details.mPeerConnectMode)
|
||||
{
|
||||
default:
|
||||
case BITDHT_CONNECT_MODE_DIRECT:
|
||||
status.mPeerConnectMode = RSDHT_TOU_MODE_DIRECT;
|
||||
break;
|
||||
case BITDHT_CONNECT_MODE_PROXY:
|
||||
status.mPeerConnectMode = RSDHT_TOU_MODE_PROXY;
|
||||
break;
|
||||
case BITDHT_CONNECT_MODE_RELAY:
|
||||
status.mPeerConnectMode = RSDHT_TOU_MODE_RELAY;
|
||||
break;
|
||||
}
|
||||
|
||||
//status.mPeerConnectProxyId = details.mPeerConnectProxyId;
|
||||
std::ostringstream out2;
|
||||
bdStdPrintId(out2, &(details.mPeerConnectProxyId));
|
||||
status.mPeerConnectProxyId = out2.str();
|
||||
|
||||
status.mCbPeerMsg = details.mPeerCbMsg;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#define PEERNET_CONNECT_TIMEOUT 45
|
||||
|
||||
#define DEBUG_BITDHT 1
|
||||
|
||||
#if 0
|
||||
int p3BitDht::add_peer(std::string id)
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#define DEBUG_BITDHT 1
|
||||
|
||||
/******************************************************************************************
|
||||
********************************* Existing Interface *************************************
|
||||
|
@ -181,6 +182,8 @@ DhtPeerDetails *p3BitDht::addInternalPeer_locked(const std::string pid, int type
|
|||
|
||||
/* what do we need to reset? */
|
||||
dpd->mPeerType = type;
|
||||
dpd->mDhtId.id = id;
|
||||
dpd->mRsId = pid;
|
||||
|
||||
return dpd;
|
||||
}
|
||||
|
@ -274,7 +277,7 @@ bool p3BitDht::havePeerTranslation_locked(const std::string &pid)
|
|||
|
||||
#ifdef DEBUG_BITDHT
|
||||
std::cerr << "p3BitDht::havePeerTranslation_locked() Found NodeId: ";
|
||||
bdStdPrintNodeId(std::cerr, id);
|
||||
bdStdPrintNodeId(std::cerr, &(it->second));
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue