mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-15 10:00:51 -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
|
@ -888,7 +888,14 @@ void p3NetMgrIMPL::netExtCheck()
|
|||
updateNetStateBox_startup();
|
||||
|
||||
/* update PeerMgr with correct info */
|
||||
mPeerMgr->UpdateOwnAddress(mLocalAddr, mExtAddr);
|
||||
if (mPeerMgr)
|
||||
{
|
||||
mPeerMgr->UpdateOwnAddress(mLocalAddr, mExtAddr);
|
||||
}
|
||||
|
||||
/* inform DHT about our external address */
|
||||
std::string fakeId;
|
||||
netAssistKnownPeer(fakeId, mExtAddr, NETASSIST_KNOWN_PEER_SELF | NETASSIST_KNOWN_PEER_ONLINE);
|
||||
|
||||
std::ostringstream out;
|
||||
out << "p3NetMgr::netExtCheck() Network Setup Complete";
|
||||
|
@ -1031,7 +1038,10 @@ bool p3NetMgrIMPL::checkNetAddress()
|
|||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mPeerMgr->UpdateOwnAddress(mLocalAddr, mExtAddr);
|
||||
if (mPeerMgr)
|
||||
{
|
||||
mPeerMgr->UpdateOwnAddress(mLocalAddr, mExtAddr);
|
||||
}
|
||||
|
||||
{
|
||||
std::ostringstream out;
|
||||
|
@ -1397,6 +1407,23 @@ bool p3NetMgrIMPL::netAssistFriend(std::string id, bool on)
|
|||
}
|
||||
|
||||
|
||||
bool p3NetMgrIMPL::netAssistKnownPeer(std::string id, const struct sockaddr_in &addr, uint32_t flags)
|
||||
{
|
||||
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
|
||||
|
||||
#ifdef NETMGR_DEBUG
|
||||
std::cerr << "p3NetMgrIMPL::netAssistKnownPeer(" << id << ")";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
for(it = mDhts.begin(); it != mDhts.end(); it++)
|
||||
{
|
||||
(it->second)->addKnownPeer(id, addr, flags);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool p3NetMgrIMPL::netAssistAttach(bool on)
|
||||
{
|
||||
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue