summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src/jabber_thread.cpp')
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 6ae5341c88..3f831ceef5 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -2094,18 +2094,17 @@ int ThreadData::recv(char *buf, size_t len)
if (this == nullptr)
return 0;
- if (bShutdown)
- return SOCKET_ERROR;
-
// this select() is still required because shitty openssl is not thread safe
- if (zRecvReady) {
+ int nSelRes;
+ do {
NETLIBSELECT nls = {};
- nls.dwTimeout = INFINITE;
+ nls.dwTimeout = 500;
nls.hReadConns[0] = s;
- int nSelRes = Netlib_Select(&nls);
+ nSelRes = Netlib_Select(&nls);
if (nSelRes == SOCKET_ERROR) // error
return SOCKET_ERROR;
}
+ while (nSelRes == 0 && !bShutdown);
if (useZlib)
return zlibRecv(buf, (long)len);