diff options
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index ec4c10fbfc..908773f418 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1995,13 +1995,16 @@ 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) {
NETLIBSELECT nls = {};
nls.dwTimeout = INFINITE;
nls.hReadConns[0] = s;
int nSelRes = Netlib_Select(&nls);
- if (nSelRes == SOCKET_ERROR || bShutdown) // error
+ if (nSelRes == SOCKET_ERROR) // error
return SOCKET_ERROR;
}
@@ -2016,6 +2019,9 @@ int ThreadData::send(char* buf, int bufsize) if (this == nullptr)
return 0;
+ if (bShutdown)
+ return SOCKET_ERROR;
+
lastWriteTime = ::GetTickCount();
if (bufsize == -1)
bufsize = (int)mir_strlen(buf);
|