mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Cleaned up More debugging and started work on connections.
* switched off lots of debugging, and removed "common" messages, so we can focus on the actions. * Added extra debugging focused on the connections. * Removed "lastconnect" from p3LinkMgr. * added p3PeerMgr::updateLastConnect() fn, so this parameter will be stored. * added calls from p3LinkMgr at connect and disconnect. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4424 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f7ff55237e
commit
81dc1d77b7
7 changed files with 78 additions and 17 deletions
|
@ -790,7 +790,7 @@ bool p3PeerMgr::updateCurrentAddress(const std::string& id, const pqiIpAddres
|
|||
it->second.ipAddrs.updateExtAddrs(addr);
|
||||
it->second.serveraddr = addr.mAddr;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "p3PeerMgr::updatedCurrentAddress() Updated Address for: " << id;
|
||||
std::cerr << std::endl;
|
||||
|
@ -801,7 +801,37 @@ bool p3PeerMgr::updateCurrentAddress(const std::string& id, const pqiIpAddres
|
|||
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool p3PeerMgr::updateLastContact(const std::string& id)
|
||||
{
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "p3PeerMgr::updateLastContact() called for id : " << id << std::endl;
|
||||
#endif
|
||||
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
/* cannot be own id */
|
||||
|
||||
/* check if it is a friend */
|
||||
std::map<std::string, peerState>::iterator it;
|
||||
if (mFriendList.end() == (it = mFriendList.find(id)))
|
||||
{
|
||||
if (mOthersList.end() == (it = mOthersList.find(id)))
|
||||
{
|
||||
std::cerr << "p3PeerMgr::updateLastContact() ERROR peer id not found: " << id << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
it->second.lastcontact = time(NULL);
|
||||
|
||||
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue