mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-23 13:15:51 -04:00
- Enabled compile on Windows (bzip2 library needed).
- Fixed crash after the second call to RsInit::InitRetroShare when keyring does not exist. The instance of AuthSSL was created twice and AuthGPG was deleted without stopping the thread. Stopped the AuthGPG thread on exit of RetroShare. - Added the correct path to the keyring for Windows in RsInit::copyGnuPGKeyrings. - Changed the detection of the portable version on Windows from the file "gpg.exe" to the file "portable". git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5211 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a91e859b66
commit
1885fb66c4
14 changed files with 92 additions and 15 deletions
|
@ -90,7 +90,7 @@ void AuthGPG::init(const std::string& path_to_public_keyring,const std::string&
|
|||
{
|
||||
if(_instance != NULL)
|
||||
{
|
||||
delete _instance ;
|
||||
exit();
|
||||
std::cerr << "AuthGPG::init() called twice!" << std::endl ;
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,16 @@ void AuthGPG::init(const std::string& path_to_public_keyring,const std::string&
|
|||
_instance = new AuthGPG(path_to_public_keyring,path_to_secret_keyring) ;
|
||||
}
|
||||
|
||||
void AuthGPG::exit()
|
||||
{
|
||||
if(_instance != NULL)
|
||||
{
|
||||
_instance->join();
|
||||
delete _instance ;
|
||||
_instance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
AuthGPG::AuthGPG(const std::string& path_to_public_keyring,const std::string& path_to_secret_keyring)
|
||||
:p3Config(CONFIG_TYPE_AUTHGPG),
|
||||
PGPHandler(path_to_public_keyring,path_to_secret_keyring),
|
||||
|
|
|
@ -110,6 +110,7 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
public:
|
||||
|
||||
static void init(const std::string& path_to_pubring, const std::string& path_to_secring);
|
||||
static void exit();
|
||||
static AuthGPG *getAuthGPG() { return _instance ; }
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,7 +66,10 @@ void setAuthSSL(AuthSSL *newssl)
|
|||
|
||||
void AuthSSLInit()
|
||||
{
|
||||
instance_ssl = new AuthSSLimpl();
|
||||
if (instance_ssl == NULL)
|
||||
{
|
||||
instance_ssl = new AuthSSLimpl();
|
||||
}
|
||||
}
|
||||
|
||||
AuthSSL *AuthSSL::getAuthSSL()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue