mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 11:54:30 -04:00
Incremental DHT improvement - support in libretroshare.
- Added missing Mutex protection in p3BitDht. - Added p3BitDht::addKnownPeer() to communicate with libbitdht. - Disabled placeholder versions (addFriend/AddFriendOfFriend) - Added netAssistKnownPeer() libretroshare interface. - Added calls to netAssistKnownPeer() from p3disc and p3NetMgr. - Check for NULL ptr in p3NetMgr before calling p3PeerMgr. - Added FIX to maintain MANUAL FORWARD port (untested!) - Removed some compiler warnings. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-dhtmods@4681 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4cd7523947
commit
7b0a33c318
12 changed files with 254 additions and 74 deletions
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "pqi/p3peermgr.h"
|
||||
#include "pqi/p3linkmgr.h"
|
||||
#include "pqi/p3netmgr.h"
|
||||
|
||||
#include "pqi/authssl.h"
|
||||
#include "pqi/authgpg.h"
|
||||
|
@ -78,10 +79,10 @@ const uint32_t P3DISC_FLAGS_ASK_VERSION = 0x0080;
|
|||
******************************************************************************************
|
||||
*****************************************************************************************/
|
||||
|
||||
p3disc::p3disc(p3PeerMgr *pm, p3LinkMgr *lm, pqipersongrp *pqih)
|
||||
p3disc::p3disc(p3PeerMgr *pm, p3LinkMgr *lm, p3NetMgr *nm, pqipersongrp *pqih)
|
||||
:p3Service(RS_SERVICE_TYPE_DISC),
|
||||
p3Config(CONFIG_TYPE_P3DISC),
|
||||
mPeerMgr(pm), mLinkMgr(lm),
|
||||
mPeerMgr(pm), mLinkMgr(lm), mNetMgr(nm),
|
||||
mPqiPersonGrp(pqih), mDiscMtx("p3disc")
|
||||
{
|
||||
RsStackMutex stack(mDiscMtx); /********** STACK LOCKED MTX ******/
|
||||
|
@ -711,6 +712,17 @@ void p3disc::recvPeerDetails(RsDiscReply *item, const std::string &certGpgId)
|
|||
/* skip if not one of our peers */
|
||||
if (!mPeerMgr->isFriend(pit->pid))
|
||||
{
|
||||
/* THESE ARE OUR FRIEND OF FRIENDS ... pass this information along to NetMgr & DHT...
|
||||
* as we can track FOF and use them as potential Proxies / Relays
|
||||
*/
|
||||
|
||||
/* add into NetMgr and non-search, so we can detect connect attempts */
|
||||
mNetMgr->netAssistFriend(pit->pid,false);
|
||||
|
||||
/* inform NetMgr that we know this peer */
|
||||
mNetMgr->netAssistKnownPeer(pit->pid, pit->currentremoteaddr,
|
||||
NETASSIST_KNOWN_PEER_FOF | NETASSIST_KNOWN_PEER_OFFLINE);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ class autoneighbour: public autoserver
|
|||
|
||||
class p3PeerMgr;
|
||||
class p3LinkMgr;
|
||||
class p3NetMgr;
|
||||
|
||||
|
||||
class p3disc: public p3Service, public pqiMonitor, public p3Config, public AuthGPGService
|
||||
|
@ -81,7 +82,7 @@ class p3disc: public p3Service, public pqiMonitor, public p3Config, public AuthG
|
|||
public:
|
||||
|
||||
|
||||
p3disc(p3PeerMgr *pm, p3LinkMgr *lm, pqipersongrp *persGrp);
|
||||
p3disc(p3PeerMgr *pm, p3LinkMgr *lm, p3NetMgr *nm, pqipersongrp *persGrp);
|
||||
|
||||
/************* from pqiMonitor *******************/
|
||||
virtual void statusChange(const std::list<pqipeer> &plist);
|
||||
|
@ -145,6 +146,7 @@ int idServers();
|
|||
|
||||
p3PeerMgr *mPeerMgr;
|
||||
p3LinkMgr *mLinkMgr;
|
||||
p3NetMgr *mNetMgr;
|
||||
|
||||
pqipersongrp *mPqiPersonGrp;
|
||||
|
||||
|
|
|
@ -187,6 +187,7 @@ int p3Dsdv::generateRoutingTables(bool incremental)
|
|||
|
||||
/* now clear significant flag */
|
||||
clearSignificantChangesFlags();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -240,6 +241,7 @@ int p3Dsdv::generateRoutingTable(const std::string &peerId, bool incremental)
|
|||
}
|
||||
}
|
||||
sendItem(dsdv);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -334,6 +336,7 @@ int p3Dsdv::handleDSDV(RsDsdvRouteItem *dsdv)
|
|||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -447,6 +450,7 @@ int p3Dsdv::printDsdvTable(std::ostream &out)
|
|||
}
|
||||
out << std::endl;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*****************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue