diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:18 +0000 |
commit | 5da14042f70711ea5cf66e034699730335462f66 (patch) | |
tree | 0f6354ccac934ed87a2d555f45be4c831cf92f4a /web/server/static | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz netdata-5da14042f70711ea5cf66e034699730335462f66.zip |
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/web/server/static/static-threaded.c (renamed from web/server/static/static-threaded.c) | 15 | ||||
-rw-r--r-- | src/web/server/static/static-threaded.h (renamed from web/server/static/static-threaded.h) | 0 | ||||
-rw-r--r-- | web/server/static/Makefile.am | 11 | ||||
-rw-r--r-- | web/server/static/README.md | 21 |
4 files changed, 8 insertions, 39 deletions
diff --git a/web/server/static/static-threaded.c b/src/web/server/static/static-threaded.c index 773d49f15..f2a07e405 100644 --- a/web/server/static/static-threaded.c +++ b/src/web/server/static/static-threaded.c @@ -40,7 +40,8 @@ static struct web_client *web_client_create_on_fd(POLLINFO *pi) { w->port_acl = pi->port_acl; int flag = 1; - if(unlikely(web_client_check_tcp(w) && setsockopt(w->ifd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)) != 0)) + if(unlikely( + web_client_check_conn_tcp(w) && setsockopt(w->ifd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)) != 0)) netdata_log_debug(D_WEB_CLIENT, "%llu: failed to enable TCP_NODELAY on socket fd %d.", w->id, w->ifd); flag = 1; @@ -142,7 +143,7 @@ static int web_server_file_read_callback(POLLINFO *pi, short int *events) { goto cleanup; } - if(unlikely(w->mode != WEB_CLIENT_MODE_FILECOPY || w->ifd == w->ofd)) { + if(unlikely(w->mode != HTTP_REQUEST_MODE_FILECOPY || w->ifd == w->ofd)) { netdata_log_debug(D_WEB_CLIENT, "%llu: PREVENTED ATTEMPT TO READ FILE ON FD %d, ON NON-FILECOPY WEB CLIENT", w->id, pi->fd); retval = -1; goto cleanup; @@ -205,13 +206,13 @@ static void *web_server_add_callback(POLLINFO *pi, short int *events, void *data struct web_client *w = web_client_create_on_fd(pi); if (!strncmp(pi->client_port, "UNIX", 4)) { - web_client_set_unix(w); + web_client_set_conn_unix(w); } else { - web_client_set_tcp(w); + web_client_set_conn_tcp(w); } #ifdef ENABLE_HTTPS - if ((!web_client_check_unix(w)) && (netdata_ssl_web_server_ctx)) { + if ((web_client_check_conn_tcp(w)) && (netdata_ssl_web_server_ctx)) { sock_delnonblock(w->ifd); //Read the first 7 bytes from the message, but the message @@ -296,11 +297,11 @@ static int web_server_rcv_callback(POLLINFO *pi, short int *events) { worker_is_busy(WORKER_JOB_PROCESS); web_client_process_request_from_web_server(w); - if (unlikely(w->mode == WEB_CLIENT_MODE_STREAM)) { + if (unlikely(w->mode == HTTP_REQUEST_MODE_STREAM)) { web_client_send(w); } - else if(unlikely(w->mode == WEB_CLIENT_MODE_FILECOPY)) { + else if(unlikely(w->mode == HTTP_REQUEST_MODE_FILECOPY)) { if(w->pollinfo_filecopy_slot == 0) { netdata_log_debug(D_WEB_CLIENT, "%llu: FILECOPY DETECTED ON FD %d", w->id, pi->fd); diff --git a/web/server/static/static-threaded.h b/src/web/server/static/static-threaded.h index a8c5335ef..a8c5335ef 100644 --- a/web/server/static/static-threaded.h +++ b/src/web/server/static/static-threaded.h diff --git a/web/server/static/Makefile.am b/web/server/static/Makefile.am deleted file mode 100644 index 59250a997..000000000 --- a/web/server/static/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -AUTOMAKE_OPTIONS = subdir-objects -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in - -SUBDIRS = \ - $(NULL) - -dist_noinst_DATA = \ - README.md \ - $(NULL) diff --git a/web/server/static/README.md b/web/server/static/README.md deleted file mode 100644 index c4e5c4c18..000000000 --- a/web/server/static/README.md +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -title: "`static-threaded` web server" -description: "The Netdata Agent's static-threaded web server spawns a fixed number of threads that listen to web requests and uses non-blocking I/O." -custom_edit_url: https://github.com/netdata/netdata/edit/master/web/server/static/README.md -sidebar_label: "`static-threaded` web server" -learn_status: "Published" -learn_topic_type: "Tasks" -learn_rel_path: "Developers/Web" ---> - -# `static-threaded` web server - -The `static-threaded` web server spawns a fixed number of threads. -All the threads are concurrently listening for web requests on the same sockets. -The kernel distributes the incoming requests to them. - -Each thread uses non-blocking I/O so it can serve any number of web requests in parallel. - -This web server respects the `keep-alive` HTTP header to serve multiple HTTP requests via the same connection. - - |