master
c 28 lines 789 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #include "api_v2_calls.h"
4
5 int api_v2_progress(RRDHOST *host __maybe_unused, struct web_client *w, char *url) {
6 char *transaction = 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, "transaction")) transaction = value;
20 }
21
22 nd_uuid_t tr;
23 uuid_parse_flexi(transaction, tr);
24
25 rrd_function_call_progresser(&tr);
26
27 return web_api_v2_report_progress(&tr, w->response.data);
28 }