summaryrefslogtreecommitdiffstats
path: root/web/server/web_client.c
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/web_client.c
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/web_client.c')
-rw-r--r--web/server/web_client.c27
1 files changed, 9 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);