From 8688c65f4c71b7f8d6708d23197aba6d2f85f0b6 Mon Sep 17 00:00:00 2001 From: drbob Date: Mon, 8 Aug 2011 11:27:40 +0000 Subject: [PATCH] * 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 --- libretroshare/src/pqi/p3peermgr.cc | 2 ++ libretroshare/src/rsserver/p3peers.cc | 8 ++++++-- libretroshare/src/services/p3vors.cc | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 2de766815..242e65667 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -1774,6 +1774,8 @@ bool p3PeerMgrIMPL::removeUnusedLocations() { removeFriend(*it); } + + return true; } diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 9f7dd3bcf..0d6215592 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -808,8 +808,12 @@ bool p3Peers::addFriend(const std::string &ssl_id, const std::string &gpg_id) return true; } - /* otherwise - we install as ssl_id. */ - return mPeerMgr->addFriend(ssl_id, gpg_id); + /* otherwise - we install as ssl_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); } diff --git a/libretroshare/src/services/p3vors.cc b/libretroshare/src/services/p3vors.cc index 3cc590ff1..1bec880f8 100644 --- a/libretroshare/src/services/p3vors.cc +++ b/libretroshare/src/services/p3vors.cc @@ -44,6 +44,8 @@ RsVoip *rsVoip = NULL; +#define MAX_PONG_RESULTS 150 +#define VORS_PING_PERIOD 10 /************ IMPLEMENTATION NOTES ********************************* * @@ -166,7 +168,6 @@ int p3VoRS::status() } -#define VORS_PING_PERIOD 10 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)); -#define MAX_PONG_RESULTS 100 while(peerInfo->mPongResults.size() > MAX_PONG_RESULTS) {