Commit 44a146fa authored by Sergey Lyubka's avatar Sergey Lyubka

SSL fixes

parent 53a55da7
...@@ -901,6 +901,7 @@ static void ns_read_from_socket(struct ns_connection *conn) { ...@@ -901,6 +901,7 @@ static void ns_read_from_socket(struct ns_connection *conn) {
} else { } else {
ok = 1; ok = 1;
} }
conn->flags &= ~(NSF_WANT_READ | NSF_WANT_WRITE);
} }
#endif #endif
conn->flags &= ~NSF_CONNECTING; conn->flags &= ~NSF_CONNECTING;
...@@ -929,6 +930,7 @@ static void ns_read_from_socket(struct ns_connection *conn) { ...@@ -929,6 +930,7 @@ static void ns_read_from_socket(struct ns_connection *conn) {
int ssl_err = ns_ssl_err(conn, res); int ssl_err = ns_ssl_err(conn, res);
if (res == 1) { if (res == 1) {
conn->flags |= NSF_SSL_HANDSHAKE_DONE; conn->flags |= NSF_SSL_HANDSHAKE_DONE;
conn->flags &= ~(NSF_WANT_READ | NSF_WANT_WRITE);
} else if (ssl_err == SSL_ERROR_WANT_READ || } else if (ssl_err == SSL_ERROR_WANT_READ ||
ssl_err == SSL_ERROR_WANT_WRITE) { ssl_err == SSL_ERROR_WANT_WRITE) {
return; // Call us again return; // Call us again
...@@ -966,6 +968,8 @@ static void ns_write_to_socket(struct ns_connection *conn) { ...@@ -966,6 +968,8 @@ static void ns_write_to_socket(struct ns_connection *conn) {
} else { } else {
conn->flags |= NSF_CLOSE_IMMEDIATELY; conn->flags |= NSF_CLOSE_IMMEDIATELY;
} }
} else {
conn->flags &= ~(NSF_WANT_READ | NSF_WANT_WRITE);
} }
} else } else
#endif #endif
......
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