summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2022-04-19 11:32:49 +0300
committerGitHub <noreply@github.com>2022-04-19 11:32:49 +0300
commit3e1ed14d8e8fd30864ddde6a236467dc4919ed13 (patch)
tree447960a7923a2fab96a96ffa23da098f5d3fc7db /web
parent9d13da121c801ddcdd37af79a19ab3cdc065f2ff (diff)
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
Diffstat (limited to 'web')
-rw-r--r--web/api/tests/valid_urls.c11
-rw-r--r--web/api/tests/web_api.c10
-rw-r--r--web/server/web_client.c10
3 files changed, 22 insertions, 9 deletions
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 <cmocka.h>
#include <stdbool.h>
+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 <cmocka.h>
#include <stdbool.h>
+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;
}
}