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) {
DBG(("%p res %d %d", conn, res, ssl_err));
if (res == 1) {
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
} else {
ok = 1;
......@@ -685,7 +685,7 @@ static void ns_read_from_socket(struct ns_connection *conn) {
DBG(("%p res %d %d", conn, res, ssl_err));
if (res == 1) {
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
} else {
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