summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-02-26 16:30:42 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-02-26 16:30:42 +0300
commit35abfdbae1d78f67b0c8ff9180a8820aadb72420 (patch)
treed3cb34e1baca27ae3adbd971fd2857ce9f8fb1d0
parent60a7c7ad23d9f616a61f3ab80783198386760a18 (diff)
another attempt to fix #2976
-rw-r--r--src/mir_app/src/netlib_ssl.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/mir_app/src/netlib_ssl.cpp b/src/mir_app/src/netlib_ssl.cpp
index 5db22b75e8..a8048d753c 100644
--- a/src/mir_app/src/netlib_ssl.cpp
+++ b/src/mir_app/src/netlib_ssl.cpp
@@ -337,19 +337,9 @@ MIR_APP_DLL(int) Netlib_SslWrite(HSSL ssl, const char *buf, int num)
MIR_APP_DLL(void) Netlib_SslShutdown(HSSL ssl)
{
if (ssl && ssl->session) {
- while (true) {
- int ret = SSL_shutdown(ssl->session);
- if (ret < 0) {
- switch (SSL_get_error(ssl->session, ret)) {
- case SSL_ERROR_WANT_READ:
- case SSL_ERROR_WANT_WRITE:
- case SSL_ERROR_WANT_ASYNC:
- case SSL_ERROR_WANT_ASYNC_JOB:
- continue;
- }
- }
- break;
- };
+ SOCKET s = SSL_get_fd(ssl->session);
+ if (s != -1)
+ shutdown(s, SD_BOTH);
}
}
@@ -437,6 +427,7 @@ bool OpenSsl_Init(void)
// SSL_read/write should transparently handle renegotiations
SSL_CTX_ctrl(g_ctx, SSL_CTRL_MODE, SSL_MODE_AUTO_RETRY, nullptr);
+ // SSL_CTX_set_quiet_shutdown(g_ctx, TRUE);
RAND_screen();