master
c 24 lines 735 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #include "api_v3_calls.h"
4
5 int api_v3_stream_info(RRDHOST *host __maybe_unused, struct web_client *w, char *url __maybe_unused) {
6 const char *machine_guid = NULL;
7
8 while(url) {
9 char *value = strsep_skip_consecutive_separators(&url, "&");
10 if(!value || !*value) continue;
11
12 char *name = strsep_skip_consecutive_separators(&value, "=");
13 if(!name || !*name) continue;
14 if(!value || !*value) continue;
15
16 // name and value are now the parameters
17 // they are not null and not empty
18
19 if(!strcmp(name, "machine_guid"))
20 machine_guid = value;
21 }
22
23 return stream_info_to_json_v1(w->response.data, machine_guid);
24 }