From 58daab21cd043e1dc37024a7f99b396788372918 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 9 Mar 2024 14:19:48 +0100 Subject: Merging upstream version 1.44.3. Signed-off-by: Daniel Baumann --- web/api/queries/query.c | 4 ++-- web/api/queries/weights.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'web/api/queries') diff --git a/web/api/queries/query.c b/web/api/queries/query.c index b7e89ee9..76d673ca 100644 --- a/web/api/queries/query.c +++ b/web/api/queries/query.c @@ -3617,12 +3617,12 @@ RRDR *rrd2rrdr(ONEWAYALLOC *owa, QUERY_TARGET *qt) { bool cancel = false; if (qt->request.interrupt_callback && qt->request.interrupt_callback(qt->request.interrupt_callback_data)) { cancel = true; - netdata_log_access("QUERY INTERRUPTED"); + nd_log(NDLS_ACCESS, NDLP_NOTICE, "QUERY INTERRUPTED"); } if (qt->request.timeout_ms && ((NETDATA_DOUBLE)(now_ut - qt->timings.received_ut) / 1000.0) > (NETDATA_DOUBLE)qt->request.timeout_ms) { cancel = true; - netdata_log_access("QUERY CANCELED RUNTIME EXCEEDED %0.2f ms (LIMIT %lld ms)", + nd_log(NDLS_ACCESS, NDLP_WARNING, "QUERY CANCELED RUNTIME EXCEEDED %0.2f ms (LIMIT %lld ms)", (NETDATA_DOUBLE)(now_ut - qt->timings.received_ut) / 1000.0, (long long)qt->request.timeout_ms); } diff --git a/web/api/queries/weights.c b/web/api/queries/weights.c index fce7b8f2..68af2250 100644 --- a/web/api/queries/weights.c +++ b/web/api/queries/weights.c @@ -112,7 +112,7 @@ static void register_result(DICTIONARY *results, RRDHOST *host, RRDCONTEXT_ACQUI // we can use the pointer address or RMA as a unique key for each metric char buf[20 + 1]; - ssize_t len = snprintfz(buf, 20, "%p", rma); + ssize_t len = snprintfz(buf, sizeof(buf) - 1, "%p", rma); dictionary_set_advanced(results, buf, len + 1, &t, sizeof(struct register_result), NULL); } @@ -717,7 +717,7 @@ static inline struct dict_unique_name_units *dict_unique_name_units_add(DICTIONA static inline struct dict_unique_id_name *dict_unique_id_name_add(DICTIONARY *dict, const char *id, const char *name, ssize_t *max_id) { char key[1024 + 1]; - snprintfz(key, 1024, "%s:%s", id, name); + snprintfz(key, sizeof(key) - 1, "%s:%s", id, name); struct dict_unique_id_name *dun = dictionary_set(dict, key, NULL, sizeof(struct dict_unique_id_name)); if(!dun->existing) { dun->existing = true; @@ -2047,7 +2047,7 @@ print("\nprob", prob) static int double_expect(double v, const char *str, const char *descr) { char buf[100 + 1]; - snprintfz(buf, 100, "%0.6f", v); + snprintfz(buf, sizeof(buf) - 1, "%0.6f", v); int ret = strcmp(buf, str) ? 1 : 0; fprintf(stderr, "%s %s, expected %s, got %s\n", ret?"FAILED":"OK", descr, str, buf); -- cgit v1.2.3