diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-27 22:01:19 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-27 22:01:19 +0000 |
commit | f5040450314c4b4ab23ab3b93ab93e0dcb2ebba8 (patch) | |
tree | 597c7626a4fc7f5b09b70a953a61b585f4c0c12c /protocols/WhatsApp/src/connection.cpp | |
parent | a0778b193508edbf795685cb6cebfca0d5ea8f8b (diff) |
WhatsApp:
- fix for the ping thread;
- fix for message notifications
git-svn-id: http://svn.miranda-ng.org/main/trunk@11932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/connection.cpp')
-rw-r--r-- | protocols/WhatsApp/src/connection.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp index 1f6b6647ec..e53d7848e8 100644 --- a/protocols/WhatsApp/src/connection.cpp +++ b/protocols/WhatsApp/src/connection.cpp @@ -129,12 +129,10 @@ void WhatsAppProto::stayConnectedLoop(void*) void WhatsAppProto::sentinelLoop(void*)
{
- int delay = MAX_SILENT_INTERVAL;
- int quietInterval;
- while (WaitForSingleObjectEx(update_loop_lock_, delay * 1000, true) == WAIT_TIMEOUT) {
+ while (WaitForSingleObjectEx(update_loop_lock_, 1000, true) == WAIT_TIMEOUT) {
if (m_iStatus != ID_STATUS_OFFLINE && m_pConnection != NULL && m_iDesiredStatus == m_iStatus) {
// #TODO Quiet after pong or tree read?
- quietInterval = difftime(time(NULL), this->lastPongTime);
+ int quietInterval = difftime(time(NULL), this->lastPongTime);
if (quietInterval >= MAX_SILENT_INTERVAL) {
try {
debugLogA("send ping");
@@ -145,9 +143,7 @@ void WhatsAppProto::sentinelLoop(void*) debugLogA("Exception: %s", e.what());
}
}
- else delay = MAX_SILENT_INTERVAL - quietInterval;
}
- else delay = MAX_SILENT_INTERVAL;
}
ResetEvent(update_loop_lock_);
debugLogA("Exiting sentinel loop");
|