summaryrefslogtreecommitdiffstats
path: root/aclk/aclk_otp.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:11 +0000
commit483926a283e118590da3f9ecfa75a8a4d62143ce (patch)
treecb77052778df9a128a8cd3ff5bf7645322a13bc5 /aclk/aclk_otp.c
parentReleasing debian version 1.31.0-4. (diff)
downloadnetdata-483926a283e118590da3f9ecfa75a8a4d62143ce.tar.xz
netdata-483926a283e118590da3f9ecfa75a8a4d62143ce.zip
Merging upstream version 1.32.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'aclk/aclk_otp.c')
-rw-r--r--aclk/aclk_otp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/aclk/aclk_otp.c b/aclk/aclk_otp.c
index 411a5f891..658e04f9b 100644
--- a/aclk/aclk_otp.c
+++ b/aclk/aclk_otp.c
@@ -2,16 +2,12 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "aclk_otp.h"
+#include "aclk_util.h"
+#include "aclk.h"
-#include "../daemon/common.h"
+#include "daemon/common.h"
-#include "../mqtt_websockets/c-rbuf/include/ringbuffer.h"
-
-// CentOS 7 has older version that doesn't define this
-// same goes for MacOS
-#ifndef UUID_STR_LEN
-#define UUID_STR_LEN 37
-#endif
+#include "mqtt_websockets/c-rbuf/include/ringbuffer.h"
struct dictionary_singleton {
char *key;
@@ -213,7 +209,7 @@ static int parse_passwd_response(const char *json_str, struct auth_data *auth) {
json = json_tokener_parse(json_str);
if (!json) {
- error("JSON-C failed to parse the payload of http respons of /env endpoint");
+ error("JSON-C failed to parse the payload of http response of /env endpoint");
return 1;
}
@@ -363,7 +359,7 @@ static int aclk_parse_otp_error(const char *json_str) {
json = json_tokener_parse(json_str);
if (!json) {
- error("JSON-C failed to parse the payload of http respons of /env endpoint");
+ error("JSON-C failed to parse the payload of http response of /env endpoint");
return 1;
}
@@ -734,7 +730,7 @@ static int parse_json_env(const char *json_str, aclk_env_t *env) {
json = json_tokener_parse(json_str);
if (!json) {
- error("JSON-C failed to parse the payload of http respons of /env endpoint");
+ error("JSON-C failed to parse the payload of http response of /env endpoint");
return 1;
}
@@ -846,7 +842,11 @@ int aclk_get_env(aclk_env_t *env, const char* aclk_hostname, int aclk_port) {
return 1;
}
- buffer_sprintf(buf, "/api/v1/env?v=%s&cap=json$claim_id=%s", &(VERSION[1]) /* skip 'v' at beginning */, agent_id);
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
+ buffer_sprintf(buf, "/api/v1/env?v=%s&cap=json,proto&claim_id=%s", &(VERSION[1]) /* skip 'v' at beginning */, agent_id);
+#else
+ buffer_sprintf(buf, "/api/v1/env?v=%s&cap=json&claim_id=%s", &(VERSION[1]) /* skip 'v' at beginning */, agent_id);
+#endif
freez(agent_id);
req.host = (char*)aclk_hostname;