From ce0a36607d110fb8e29942392d044ae8a29cd483 Mon Sep 17 00:00:00 2001 From: drbob Date: Mon, 8 Aug 2011 12:02:17 +0000 Subject: [PATCH] As certificate cleaning is very much more brutal now... (strip all SSL certs not connected to recently). I've reduced the frequency, and increased the age for removal. * Cleared every 31 minutes, first cleaning after 1 hour. * old peer is no contact for 90 days. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4547 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/p3peermgr.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 242e65667..9bf48e970 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -64,6 +64,8 @@ const uint32_t MIN_TIME_BETWEEN_NET_RESET = 5; const uint32_t PEER_IP_CONNECT_STATE_MAX_LIST_SIZE = 4; +#define VERY_OLD_PEER (90 * 24 * 3600) // 90 days. + /**** * #define PEER_DEBUG 1 ***/ @@ -183,9 +185,8 @@ void p3PeerMgrIMPL::setOwnVisState(uint32_t visState) void p3PeerMgrIMPL::tick() { - static time_t last_friends_check = time(NULL) ; - //static const time_t INTERVAL_BETWEEN_LOCATION_CLEANING = 600 ; // Remove unused locations every 10 minutes. - static const time_t INTERVAL_BETWEEN_LOCATION_CLEANING = 480 ; // Switch to 8 minutes -> see if it changes + static const time_t INTERVAL_BETWEEN_LOCATION_CLEANING = 1860 ; // Remove unused locations every 31 minutes. + static time_t last_friends_check = time(NULL) + INTERVAL_BETWEEN_LOCATION_CLEANING; // first cleaning after 1 hour. time_t now = time(NULL) ; @@ -1728,7 +1729,6 @@ bool isDummyFriend(std::string id) return ret; } -#define VERY_OLD_PEER (30 * 24 * 3600) // 30 days. bool p3PeerMgrIMPL::removeUnusedLocations() {