diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2011-04-01 10:14:07 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2011-04-01 10:14:07 +0300 |
commit | 77664979ae7f2e534e31f66aa9286d874d9da2bc (patch) | |
tree | 854290346b15a887b2a6005bde46e912089615ce /utilities.cpp | |
parent | 21f2c63d296d4cdf534de24a216811b4c4b744fc (diff) |
modified: gpg_wrapper.cpp
modified: gpg_wrapper.h
modified: main.cpp
modified: messages.cpp
modified: options.cpp
modified: utilities.cpp
Diffstat (limited to 'utilities.cpp')
-rw-r--r-- | utilities.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/utilities.cpp b/utilities.cpp index 8d33d4b..c8dc2ae 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -380,6 +380,7 @@ int onProtoAck(WPARAM w, LPARAM l) { delete gpg_thread; TerminateProcess(params.hProcess, 1); + params.hProcess = NULL; debuglog<<time_str()<<": GPG execution timed out, aborted\n"; return 0; } @@ -424,6 +425,7 @@ int onProtoAck(WPARAM w, LPARAM l) { delete gpg_thread; TerminateProcess(params.hProcess, 1); + params.hProcess = NULL; debuglog<<time_str()<<": GPG execution timed out, aborted\n"; DeleteFile(filename); return 0; @@ -490,6 +492,7 @@ std::wstring encrypt_file(HANDLE hContact, TCHAR *filename) { delete gpg_thread; TerminateProcess(params.hProcess, 1); + params.hProcess = NULL; debuglog<<time_str()<<": GPG execution timed out, aborted\n"; return 0; } @@ -505,6 +508,7 @@ std::wstring encrypt_file(HANDLE hContact, TCHAR *filename) { delete gpg_thread; TerminateProcess(params.hProcess, 1); + params.hProcess = NULL; debuglog<<time_str()<<": GPG execution timed out, aborted\n"; return 0; } @@ -771,6 +775,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU { gpg_thread.~thread(); TerminateProcess(params.hProcess, 1); + params.hProcess = NULL; debuglog<<time_str()<<"GPG execution timed out, aborted\n"; } DeleteFile(path_out.c_str()); @@ -899,17 +904,15 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi { gpg_thread.~thread(); TerminateProcess(params.hProcess, 1); + params.hProcess = NULL; debuglog<<time_str()<<": GPG execution timed out, aborted\n"; -// sign_file_mutex.unlock(); return FALSE; } if(result == pxNotFound) { -// sign_file_mutex.unlock(); return FALSE; } DeleteFile(path_out.c_str()); -// sign_file_mutex.unlock(); if(out.find("key ID ") != string::npos) { //need to get hcontact here, i can get jid from hxml, and get handle from jid, maybe exists better way ? @@ -981,13 +984,16 @@ bool isContactSecured(HANDLE hContact) debuglog<<time_str()<<": encryption is turned of for "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<"\n"; return false; } - TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); - if(!key[0] && !metaIsProtoMetaContacts(hContact)) + if(!metaIsProtoMetaContacts(hContact)) { + TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); + if(!key[0]) + { + mir_free(key); + return false; + } mir_free(key); - return false; } - mir_free(key); return true; } |