Commit 67c44799 authored by Sergey Lyubka's avatar Sergey Lyubka

SSL_accept() error handling fix

parent 4646e2ad
...@@ -659,7 +659,7 @@ static void ns_read_from_socket(struct ns_connection *conn) { ...@@ -659,7 +659,7 @@ static void ns_read_from_socket(struct ns_connection *conn) {
DBG(("%p res %d %d", conn, res, ssl_err)); DBG(("%p res %d %d", conn, res, ssl_err));
if (res == 1) { if (res == 1) {
conn->flags = NSF_SSL_HANDSHAKE_DONE; conn->flags = NSF_SSL_HANDSHAKE_DONE;
} else if (res == 0 || ssl_err == 2 || ssl_err == 3) { } else if (res == 0 && (ssl_err == 2 || ssl_err == 3)) {
return; // Call us again return; // Call us again
} else { } else {
ok = 1; ok = 1;
...@@ -685,7 +685,7 @@ static void ns_read_from_socket(struct ns_connection *conn) { ...@@ -685,7 +685,7 @@ static void ns_read_from_socket(struct ns_connection *conn) {
DBG(("%p res %d %d", conn, res, ssl_err)); DBG(("%p res %d %d", conn, res, ssl_err));
if (res == 1) { if (res == 1) {
conn->flags |= NSF_SSL_HANDSHAKE_DONE; conn->flags |= NSF_SSL_HANDSHAKE_DONE;
} else if (res == 0 || ssl_err == 2 || ssl_err == 3) { } else if (res == 0 && (ssl_err == 2 || ssl_err == 3)) {
return; // Call us again return; // Call us again
} else { } else {
conn->flags |= NSF_CLOSE_IMMEDIATELY; conn->flags |= NSF_CLOSE_IMMEDIATELY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment