Cleaned up rsPeers to remove 10 minute reconnect. The reconnect was caused by

the periodical call of cleanupUsedLocation, which was reloading all the GPG Keys - for each cleanup Key.
This required cleaning up various bits (AuthGPG, rsPeers, p3Disc).

 * moved rsPeer::cleanUnusedLocations => p3PeerMgr::removeUnusedLocations();
 	- made the function light-weight, no loading of GPG Keys.
 * moved getSSLCertsFromGPG() fn from rsPeers => p3PeerMgr
 * added p3PeerMgr::removeAllFriendLocations() to cleanup when removing a GPG Friend.
 * cleaned up rsPeers, made addFriend() / removeFriend() universal functions.
 * remove bool   p3Peers::setAcceptToConnectGPGCertificate(const std::string &gpg_id, bool acceptance)
 * removed all Dummy SSL Ids. - There is no need for this!
 * Major changes to p3disc to correct FLAWED logic.  (needs more testing).
 * removed as many dependancies on retroshare/rspeer.h as possible.
 * changed p3turtle dependancy on rsPeers ==> mLinkMgr.
 * added p3LinkMgr::getPeerName() and p3PeerMgr::getPeerName()
 * added return 1 to pqissllistener::closeConnection().
 * removed unused code from AuthGPG().
 * removed storeAllKeys() calls in AuthGPG::AllowConnection().



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4542 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2011-08-07 21:11:00 +00:00
parent 80629c5d9b
commit 8e3e7d5209
20 changed files with 1000 additions and 673 deletions

File diff suppressed because it is too large Load diff

View file

@ -129,6 +129,7 @@ void recvPeerDetails(RsDiscReply *item, const std::string &certGpgId);
//void recvPeerIssuerMsg(RsDiscIssuer *item);
void recvPeerVersionMsg(RsDiscVersion *item);
void recvHeartbeatMsg(RsDiscHeartbeat *item);
void recvDiscReply(RsDiscReply *dri);
void removeFriend(std::string ssl_id); //keep tracks of removed friend so we're not gonna add them again immediately
@ -146,22 +147,27 @@ int idServers();
p3LinkMgr *mLinkMgr;
pqipersongrp *mPqiPersonGrp;
time_t lastSentHeartbeatTime;
/* data */
RsMutex mDiscMtx;
std::map<std::string, time_t> deletedSSLFriendsIds;
time_t mLastSentHeartbeatTime;
bool mDiscEnabled;
std::map<std::string, autoneighbour> neighbours;
std::map<std::string, std::string> versions;
//std::map<std::string, time_t> deletedSSLFriendsIds;
std::map<std::string, std::list<std::string> > sendIdList;
std::list<RsDiscReply*> pendingDiscReplyInList;
std::map<std::string, std::list<std::string> > mSendIdList;
std::list<RsDiscReply*> mPendingDiscReplyInList;
// Neighbors at the gpg level.
//
std::map<std::string,std::set<std::string> > gpg_neighbors ;
// Original mapping.
std::map<std::string, autoneighbour> neighbours;
// Rs Version.
std::map<std::string, std::string> versions;
};

View file

@ -49,6 +49,7 @@
#include "pqi/authssl.h"
#include "pqi/authgpg.h"
#include "retroshare/rspeers.h" // Needed for RsPeerDetails & Online List. (Should remove dependance)
#define FAILED_CACHE_CONT "failedcachegrp" // cache id which have failed are stored under a node of this name/grpid
#define HIST_CACHE_FNAME "grp_history.xml"

View file

@ -24,9 +24,9 @@
*/
#include "retroshare/rsiface.h"
#include "retroshare/rsinit.h" /* for PGPSSL flag */
#include "retroshare/rspeers.h"
//#include "retroshare/rsiface.h"
//#include "retroshare/rsinit.h" /* for PGPSSL flag */
//#include "retroshare/rspeers.h"
#include "services/p3tunnel.h"
#include "pqi/pqissltunnel.h"
#include <sstream>