diff options
author | George Hazan <george.hazan@gmail.com> | 2023-06-05 11:53:25 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-06-05 11:53:25 +0300 |
commit | dc418014faa677baf581d14ec101c1ecbc916fe8 (patch) | |
tree | 9ec22967af6b60f1e400040467921b2575985fcf | |
parent | ef8f9c7b1a42e314f41b214d14169f11d1458d44 (diff) |
fixes #3531 (Jabber: невозможно отменить процесс подключения)
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 11 |
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);
|