From dc418014faa677baf581d14ec101c1ecbc916fe8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 5 Jun 2023 11:53:25 +0300 Subject: =?UTF-8?q?fixes=20#3531=20(Jabber:=20=D0=BD=D0=B5=D0=B2=D0=BE?= =?UTF-8?q?=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D1=8C=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81?= =?UTF-8?q?=D1=81=20=D0=BF=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/JabberG/src/jabber_thread.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'protocols/JabberG/src') 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); -- cgit v1.2.3