summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-27 18:46:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-27 18:46:10 +0000
commit9abec302a4736c965a34b930f4f5bf2b1494bf6e (patch)
treeaef24838cdda26750d86362b832263f4bcdf5a0e /web
parentAdding upstream version 1.40.0. (diff)
downloadnetdata-9abec302a4736c965a34b930f4f5bf2b1494bf6e.tar.xz
netdata-9abec302a4736c965a34b930f4f5bf2b1494bf6e.zip
Adding upstream version 1.40.1.upstream/1.40.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web')
-rw-r--r--web/server/web_client.c6
1 files changed, 6 insertions, 0 deletions
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);