summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utilities.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/utilities.cpp b/utilities.cpp
index 40c4b32..afa9440 100644
--- a/utilities.cpp
+++ b/utilities.cpp
@@ -831,6 +831,8 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi
sign_file_mutex.lock();
DeleteFile(path_out.c_str());
wfstream f(path_out.c_str(), std::ios::out);
+ while(!f.is_open())
+ f.open(path_out.c_str(), std::ios::out);
f<<toUTF8(sign).c_str();
f.close();
if(_waccess(path_out.c_str(), 0) == -1)
@@ -860,10 +862,14 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi
{
gpg_thread.~thread();
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)
@@ -883,7 +889,6 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi
break;
hContact = (*p)->getJabberInterface()->Sys()->ContactFromJID(xi.getAttrValue(node, _T("from")));
if(hContact)
-// DBWriteContactSettingString(hContact, szGPGModuleName, "KeyID_Prescense", out.substr(p1, p2-p1-1).c_str());
hcontact_data[hContact].key_in_prescense = out.substr(p1, p2-p1-1).c_str();
}
}