From 3e1ed14d8e8fd30864ddde6a236467dc4919ed13 Mon Sep 17 00:00:00 2001 From: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> Date: Tue, 19 Apr 2022 11:32:49 +0300 Subject: Add the ability to perform a data query using an offline node id (#12650) * Add the ability to build a host structure by node id to execute queries for archived hosts * Add the ability to execute queries from the cloud for archived hosts by node id * Add free_temporary_host function --- web/api/tests/valid_urls.c | 11 +++++++++++ web/api/tests/web_api.c | 10 ++++++++++ web/server/web_client.c | 10 +--------- 3 files changed, 22 insertions(+), 9 deletions(-) (limited to 'web') diff --git a/web/api/tests/valid_urls.c b/web/api/tests/valid_urls.c index 30dc298285..87d5b3a208 100644 --- a/web/api/tests/valid_urls.c +++ b/web/api/tests/valid_urls.c @@ -8,6 +8,17 @@ #include #include +void free_temporary_host(RRDHOST *host) +{ + (void) host; +} + +void *__wrap_free_temporary_host(RRDHOST *host) +{ + (void) host; +} + + RRDHOST *sql_create_host_by_uuid(char *hostname) { (void) hostname; diff --git a/web/api/tests/web_api.c b/web/api/tests/web_api.c index df4efdabd2..53ce53da1d 100644 --- a/web/api/tests/web_api.c +++ b/web/api/tests/web_api.c @@ -8,6 +8,16 @@ #include #include +void free_temporary_host(RRDHOST *host) +{ + (void) host; +} + +void *__wrap_free_temporary_host(RRDHOST *host) +{ + (void) host; +} + RRDHOST *sql_create_host_by_uuid(char *hostname) { (void) hostname; diff --git a/web/server/web_client.c b/web/server/web_client.c index e61dc0a547..f388ab94b3 100644 --- a/web/server/web_client.c +++ b/web/server/web_client.c @@ -1309,15 +1309,7 @@ static inline int web_client_switch_host(RRDHOST *host, struct web_client *w, ch host = sql_create_host_by_uuid(tok); if (likely(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(host->program_name); - freez(host->program_version); - freez(host->registry_hostname); - freez(host->system_info); - freez(host); + free_temporary_host(host); return rc; } } -- cgit v1.2.3