summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_openssl.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2019-03-01 18:20:05 +0300
committerIgor Sysoev <igor@sysoev.ru>2019-03-01 18:20:05 +0300
commit86d4a0e473ee2f207f83357e8a3f32b2e20e4e12 (patch)
tree3a90202e95c070e3b2ca3ab5d9519a054fe9b1a5 /src/nxt_openssl.c
parent1b0595c74c62a73741f96794651fe284e4c1ec86 (diff)
downloadunit-86d4a0e473ee2f207f83357e8a3f32b2e20e4e12.tar.gz
unit-86d4a0e473ee2f207f83357e8a3f32b2e20e4e12.tar.bz2
Fixed TLS connections hanging.
After event is delivered from the kernel its further processing is blocked. Non-ready TSL I/O operation should mark connection I/O state as not ready to unblock events and to allow their further processing. Otherwise the connection hangs.
Diffstat (limited to 'src/nxt_openssl.c')
-rw-r--r--src/nxt_openssl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nxt_openssl.c b/src/nxt_openssl.c
index 99dd2077..c01f92c8 100644
--- a/src/nxt_openssl.c
+++ b/src/nxt_openssl.c
@@ -855,12 +855,11 @@ nxt_openssl_conn_test_error(nxt_task_t *task, nxt_conn_t *c, int ret,
switch (tls->ssl_error) {
case SSL_ERROR_WANT_READ:
+ c->socket.read_ready = 0;
if (io != NXT_OPENSSL_READ) {
nxt_fd_event_block_write(task->thread->engine, &c->socket);
- c->socket.read_ready = 0;
-
if (nxt_fd_event_is_disabled(c->socket.read)) {
nxt_fd_event_enable_read(task->thread->engine, &c->socket);
}
@@ -869,12 +868,11 @@ nxt_openssl_conn_test_error(nxt_task_t *task, nxt_conn_t *c, int ret,
return NXT_AGAIN;
case SSL_ERROR_WANT_WRITE:
+ c->socket.write_ready = 0;
if (io != NXT_OPENSSL_WRITE) {
nxt_fd_event_block_read(task->thread->engine, &c->socket);
- c->socket.write_ready = 0;
-
if (nxt_fd_event_is_disabled(c->socket.write)) {
nxt_fd_event_enable_write(task->thread->engine, &c->socket);
}