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:
drbob 2011-11-22 13:24:42 +00:00
parent 4cd7523947
commit 7b0a33c318
12 changed files with 254 additions and 74 deletions

View file

@ -716,7 +716,28 @@ bool p3PeerMgrIMPL::UpdateOwnAddress(const struct sockaddr_in &localAddr, const
ipAddressTimed.mSeenTime = time(NULL);
mOwnState.ipAddrs.updateExtAddrs(ipAddressTimed);
mOwnState.serveraddr = extAddr;
/* Attempted Fix to MANUAL FORWARD Mode....
* don't update the server address - if we are in this mode
*
* It is okay - if they get it wrong, as we put the address in the address list anyway.
* This should keep people happy, and allow for misconfiguration!
*/
if (mOwnState.netMode & RS_NET_MODE_TRY_EXT)
{
mOwnState.serveraddr.sin_addr.s_addr = extAddr.sin_addr.s_addr;
std::cerr << "p3PeerMgrIMPL::UpdateOwnAddress() Disabling Update of Server Port ";
std::cerr << " as MANUAL FORWARD Mode";
std::cerr << std::endl;
std::cerr << "Address is Now: ";
std::cerr << rs_inet_ntoa(mOwnState.serveraddr.sin_addr);
std::cerr << ":" << htons(mOwnState.serveraddr.sin_port);
std::cerr << std::endl;
}
else
{
mOwnState.serveraddr = extAddr;
}
}
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/