From 9900e305cf4109599775213d14edc842d5fad8b5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 13 Sep 2023 11:05:54 +0200 Subject: Merging upstream version 1.42.3. Signed-off-by: Daniel Baumann --- libnetdata/socket/security.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libnetdata/socket') diff --git a/libnetdata/socket/security.c b/libnetdata/socket/security.c index c1bb76345..3a3a171e5 100644 --- a/libnetdata/socket/security.c +++ b/libnetdata/socket/security.c @@ -234,6 +234,11 @@ ssize_t netdata_ssl_read(NETDATA_SSL *ssl, void *buf, size_t num) { if(unlikely(bytes <= 0)) { int err = SSL_get_error(ssl->conn, bytes); + if (err == SSL_ERROR_ZERO_RETURN) { + ssl->ssl_errno = err; + return 0; + } + if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) { ssl->ssl_errno = err; errno = EWOULDBLOCK; -- cgit v1.2.3