From 3e08021083ce71a0a86b0e345227df4afacef72b Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 14 Dec 2021 18:36:55 +0000 Subject: [PATCH] Don't rely on -1 return value from SSL_read, just check SSL_get_error() directly --- nsock/src/nsock_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nsock/src/nsock_core.c b/nsock/src/nsock_core.c index 3d60ac638..3e6412151 100644 --- a/nsock/src/nsock_core.c +++ b/nsock/src/nsock_core.c @@ -452,11 +452,11 @@ void handle_connect_result(struct npool *ms, struct nevent *nse, enum nse_status #endif sslerr = SSL_get_error(iod->ssl, rc); - if (rc == -1 && sslerr == SSL_ERROR_WANT_READ) { + if (sslerr == SSL_ERROR_WANT_READ) { nse->sslinfo.ssl_desire = sslerr; socket_count_read_inc(iod); update_events(iod, ms, nse, EV_READ, EV_NONE); - } else if (rc == -1 && sslerr == SSL_ERROR_WANT_WRITE) { + } else if (sslerr == SSL_ERROR_WANT_WRITE) { nse->sslinfo.ssl_desire = sslerr; socket_count_write_inc(iod); update_events(iod, ms, nse, EV_WRITE, EV_NONE);