summaryrefslogtreecommitdiffstats
path: root/web/server
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-31 12:58:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-31 12:58:11 +0000
commitf99c4526d94d3e04124c5c48ab4a3da6ca53a458 (patch)
treea2ed8860030cc49f492b09b3222d593c65619800 /web/server
parentAdding upstream version 1.29.3. (diff)
downloadnetdata-f99c4526d94d3e04124c5c48ab4a3da6ca53a458.tar.xz
netdata-f99c4526d94d3e04124c5c48ab4a3da6ca53a458.zip
Adding upstream version 1.30.0.upstream/1.30.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server')
-rw-r--r--web/server/web_client.c27
-rw-r--r--web/server/web_client.h1
2 files changed, 10 insertions, 18 deletions
diff --git a/web/server/web_client.c b/web/server/web_client.c
index f0856fb17..5e3de38d5 100644
--- a/web/server/web_client.c
+++ b/web/server/web_client.c
@@ -55,7 +55,7 @@ static inline int web_client_uncrock_socket(struct web_client *w) {
return 0;
}
-static inline char *strip_control_characters(char *url) {
+char *strip_control_characters(char *url) {
char *s = url;
if(!s) return "";
@@ -1374,34 +1374,25 @@ static inline int web_client_switch_host(RRDHOST *host, struct web_client *w, ch
uint32_t hash = simple_hash(tok);
host = rrdhost_find_by_hostname(tok, hash);
- if(!host) host = rrdhost_find_by_guid(tok, hash);
-
-#ifdef ENABLE_DBENGINE
- int release_host = 0;
+ if (!host)
+ host = rrdhost_find_by_guid(tok, hash);
if (!host) {
host = sql_create_host_by_uuid(tok);
if (likely(host)) {
- rrdhost_flag_set(host, RRDHOST_FLAG_ARCHIVED);
- release_host = 1;
- }
- }
- if(host) {
- int rc = web_client_process_url(host, w, url);
- if (release_host) {
+ int rc = web_client_process_url(host, w, url);
freez(host->hostname);
- freez((char *) host->os);
- freez((char *) host->tags);
- freez((char *) host->timezone);
+ freez((char *)host->os);
+ freez((char *)host->tags);
+ freez((char *)host->timezone);
freez(host->program_name);
freez(host->program_version);
freez(host->registry_hostname);
+ freez(host->system_info);
freez(host);
+ return rc;
}
- return rc;
}
-#else
if (host) return web_client_process_url(host, w, url);
-#endif
}
buffer_flush(w->response.data);
diff --git a/web/server/web_client.h b/web/server/web_client.h
index 48bf1ac86..4580b9749 100644
--- a/web/server/web_client.h
+++ b/web/server/web_client.h
@@ -211,6 +211,7 @@ extern void buffer_data_options2string(BUFFER *wb, uint32_t options);
extern int mysendfile(struct web_client *w, char *filename);
extern void web_client_build_http_header(struct web_client *w);
+extern char *strip_control_characters(char *url);
#include "daemon/common.h"