* Added "lastcontact = now" when added SSL Peer. This ensures that new certificates will be retained for at least 30 days.

=> Giving new peers a chance to connect.
 * Fixed missing return in p3PeerMgr::removeUnusedLocations()
 * moved RTT defines to top of file, and increased to 150 results.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4546 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2011-08-08 11:27:40 +00:00
parent cd41eda638
commit 8688c65f4c
3 changed files with 10 additions and 4 deletions

View File

@ -1774,6 +1774,8 @@ bool p3PeerMgrIMPL::removeUnusedLocations()
{ {
removeFriend(*it); removeFriend(*it);
} }
return true;
} }

View File

@ -808,8 +808,12 @@ bool p3Peers::addFriend(const std::string &ssl_id, const std::string &gpg_id)
return true; return true;
} }
/* otherwise - we install as ssl_id. */ /* otherwise - we install as ssl_id.....
return mPeerMgr->addFriend(ssl_id, gpg_id); * If we are adding an SSL certificate. we flag lastcontact as now.
* This will cause the SSL certificate to be retained for 30 days... and give the person a chance to connect!
* */
time_t now = time(NULL);
return mPeerMgr->addFriend(ssl_id, gpg_id, RS_NET_MODE_UDP, RS_VIS_STATE_STD, now);
} }

View File

@ -44,6 +44,8 @@
RsVoip *rsVoip = NULL; RsVoip *rsVoip = NULL;
#define MAX_PONG_RESULTS 150
#define VORS_PING_PERIOD 10
/************ IMPLEMENTATION NOTES ********************************* /************ IMPLEMENTATION NOTES *********************************
* *
@ -166,7 +168,6 @@ int p3VoRS::status()
} }
#define VORS_PING_PERIOD 10
int p3VoRS::sendPackets() int p3VoRS::sendPackets()
{ {
@ -406,7 +407,6 @@ int p3VoRS::storePongResult(std::string id, uint32_t counter, double ts, double
peerInfo->mPongResults.push_back(RsVoipPongResult(ts, rtt, offset)); peerInfo->mPongResults.push_back(RsVoipPongResult(ts, rtt, offset));
#define MAX_PONG_RESULTS 100
while(peerInfo->mPongResults.size() > MAX_PONG_RESULTS) while(peerInfo->mPongResults.size() > MAX_PONG_RESULTS)
{ {