summaryrefslogtreecommitdiff
path: root/utilities.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2011-03-23 13:44:24 +0200
committerGluzskiy Alexandr <sss123next@list.ru>2011-03-23 13:44:24 +0200
commit9588dec6833519fa4060cc347f11f808f99ca1e6 (patch)
tree06b4c6541b7a01f6e7044a06c3a1c5a1b13ef427 /utilities.cpp
parent1d054f287ebeafb682b2019994919ab5c803082f (diff)
modified: utilities.cpp
Diffstat (limited to 'utilities.cpp')
-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();
}
}