From c933bf105b0de89e3fd524517daf163a16dd0d44 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 27 Jun 2023 20:46:20 +0200 Subject: Merging upstream version 1.40.1. Signed-off-by: Daniel Baumann --- web/server/web_client.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web') diff --git a/web/server/web_client.c b/web/server/web_client.c index 6e3c1225e..5dcff0b0f 100644 --- a/web/server/web_client.c +++ b/web/server/web_client.c @@ -1933,6 +1933,8 @@ ssize_t web_client_receive(struct web_client *w) // do we have any space for more data? buffer_need_bytes(w->response.data, NETDATA_WEB_REQUEST_INITIAL_SIZE); + errno = 0; + #ifdef ENABLE_HTTPS if ( (!web_client_check_unix(w)) && (netdata_ssl_web_server_ctx) ) { if (SSL_connection(&w->ssl)) { @@ -1962,6 +1964,10 @@ ssize_t web_client_receive(struct web_client *w) debug(D_WEB_CLIENT, "%llu: Received %zd bytes.", w->id, bytes); debug(D_WEB_DATA, "%llu: Received data: '%s'.", w->id, &w->response.data->buffer[old]); } + else if(unlikely(bytes < 0 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR))) { + web_client_enable_wait_receive(w); + return 0; + } else if (bytes < 0) { debug(D_WEB_CLIENT, "%llu: receive data failed.", w->id); WEB_CLIENT_IS_DEAD(w); -- cgit v1.2.3