@cryptotaxi247 / netdata-1 / commits / f62198716

fix log if D_ACLK is used (#11763)

Timotej S committed Nov 9, 2021 at 08:53 UTC f62198716ad35ed1f4872a9bdf5ce745591a13ca
1 file changed +8 -1
aclk/aclk_rx_msgs.c
+8 -1
@@ -266,7 +266,14 @@ void aclk_handle_new_cloud_msg(const char *message_type, const char *msg, size_t
266 // TODO do the look up table with hashes to optimize when there are more
267 // than few
268 if (!strcmp(message_type, "cmd")) {
269 - aclk_handle_cloud_message((char *)msg);
269 + // msg is binary payload in all other cases
270 + // however in this message from old legacy cloud
271 + // we have to convert it to C string
272 + char *str = mallocz(msg_len+1);
273 + memcpy(str, msg, msg_len);
274 + str[msg_len] = 0;
275 + aclk_handle_cloud_message(str);
276 + freez(str);
277 return;
278 }
279 if (!strcmp(message_type, "CreateNodeInstanceResult")) {