added auto-remove of unused and dummy locations every 10 minutes (still keeping at least one location for each GPG key). Suppressed exchange of p3disc info for dummy locations.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3915 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-12-14 21:56:37 +00:00
parent 1495758d45
commit 98f471c56b
6 changed files with 239 additions and 148 deletions

View file

@ -570,6 +570,18 @@ void p3ConnectMgr::tick()
statusTick();
tickMonitors();
static time_t last_friends_check = time(NULL) ;
static const time_t INTERVAL_BETWEEN_LOCATION_CLEANING = 600 ; // Remove unused locations every 10 minutes.
time_t now = time(NULL) ;
if(now > last_friends_check + INTERVAL_BETWEEN_LOCATION_CLEANING && rsPeers != NULL)
{
std::cerr << "p3ConnectMgr::tick(): cleaning unused locations." << std::endl ;
rsPeers->cleanUnusedLocations() ;
last_friends_check = now ;
}
}
bool p3ConnectMgr::shutdown() /* blocking shutdown call */