diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-08-17 12:49:48 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-08-17 12:49:48 +0200 |
commit | b9e11915a976daaf790ebc763aff56e19fd49e0f (patch) | |
tree | 7c69dc9427a8a0470ff12f772846b956e747bf78 /src/modules/extra | |
parent | f9fd78c01623514a060c607534fc52cb73140200 (diff) | |
parent | c7a26bc21629ddd4103dac1ff7f9acf45a2c4d35 (diff) |
Merge insp20
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 3 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index bda4e6a48..e5cb8ee90 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -1076,6 +1076,9 @@ info_done_dealloc: if (ret > 0) { reader.appendto(recvq); + // Schedule a read if there is still data in the GnuTLS buffer + if (gnutls_record_check_pending(sess) > 0) + SocketEngine::ChangeEventMask(user, FD_ADD_TRIAL_READ); return 1; } else if (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 4df0d8962..8467cc6d4 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -631,8 +631,14 @@ class OpenSSLIOHook : public SSLIOHook if (ret > 0) { recvq.append(buffer, ret); + int mask = 0; + // Schedule a read if there is still data in the OpenSSL buffer + if (SSL_pending(sess) > 0) + mask |= FD_ADD_TRIAL_READ; if (data_to_write) - SocketEngine::ChangeEventMask(user, FD_WANT_POLL_READ | FD_WANT_SINGLE_WRITE); + mask |= FD_WANT_POLL_READ | FD_WANT_SINGLE_WRITE; + if (mask != 0) + SocketEngine::ChangeEventMask(user, mask); return 1; } else if (ret == 0) |