Optimized startup of RetroShare by removing two unnecessary calls to AuthGPGimpl::storeAllKeys.

Fixed small hangs of RetroShare by removing the core lock in RsServer::ConfigGetDataRates. Is that needed?

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4725 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-12-12 09:37:03 +00:00
parent ef57cd44b3
commit e150e31401
5 changed files with 54 additions and 23 deletions

View file

@ -315,9 +315,24 @@ int AuthGPGimpl::GPGInit(const std::string &ownId)
}
mOwnGpgId = ownId;
}
storeAllKeys();
// clear old cert
gpgme_key_unref(mOwnGpgCert.key);
mOwnGpgCert = gpgcert();
// search own key
certmap::iterator it = mKeyList.find(mOwnGpgId);
if (it != mKeyList.end()) {
it->second.ownsign = true;
// store own key, grab a reference, so the key remains
gpgme_key_ref(it->second.key);
mOwnGpgCert = it->second;
}
}
// already stored in AuthGPGimpl::InitAuth
// storeAllKeys();
int lvl = 0;
@ -2319,7 +2334,8 @@ bool AuthGPGimpl::loadList(std::list<RsItem*>& load)
std::cerr << "AuthGPGimpl::loadList() Item Count: " << load.size() << std::endl;
#endif
storeAllKeys();
// already stored in AuthGPGimpl::InitAuth
// storeAllKeys();
RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
/* load the list of accepted gpg keys */