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