@cryptotaxi247 / netdata-1 / commits / f8f4aed80

Fixed the data endpoint so that the context param is correctly applied to children (#10290)

Stelios Fragkakis committed Nov 26, 2020 at 13:00 UTC f8f4aed80d34967ba61de14463e9520829edcdc2
1 file changed +3 -3
web/api/web_api_v1.c
+3 -3
@@ -499,12 +499,12 @@ inline int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, c
499 if (context && !chart) {
500 RRDSET *st1;
501 uint32_t context_hash = simple_hash(context);
502 - rrdhost_rdlock(localhost);
503 - rrdset_foreach_read(st1, localhost) {
502 + rrdhost_rdlock(host);
503 + rrdset_foreach_read(st1, host) {
504 if (st1->hash_context == context_hash && !strcmp(st1->context, context))
505 build_context_param_list(&context_param_list, st1);
506 }
507 - rrdhost_unlock(localhost);
507 + rrdhost_unlock(host);
508 if (likely(context_param_list && context_param_list->rd)) // Just set the first one
509 st = context_param_list->rd->rrdset;
510 }