@@ -106,7 +106,7 @@ static channel_data_t channel_data_defaults = {.debug = false,
#ifdef CONFIG_SURICATTA_SSL
.usessl = true,
#endif
- .format = CHANNEL_PARSE_RAW,
+ .format = CHANNEL_PARSE_NONE,
.nocheckanswer = true,
.nofollow = true,
.strictssl = true};
@@ -316,6 +316,7 @@ server_op_res_t server_send_cancel_reply(channel_t *channel, const int action_id
channel_data_reply.url = url;
channel_data_reply.request_body = json_reply_string;
channel_data_reply.method = CHANNEL_POST;
+ channel_data_reply.format = CHANNEL_PARSE_NONE;
result = map_channel_retcode(channel->put(channel, (void *)&channel_data_reply));
cleanup:
@@ -325,11 +326,6 @@ cleanup:
if (json_reply_string != NULL) {
free(json_reply_string);
}
- if (channel_data_reply.json_reply != NULL &&
- json_object_put(channel_data_reply.json_reply) !=
- JSON_OBJECT_FREED) {
- ERROR("JSON object should be freed but was not.");
- }
/*
* Send always a notification
@@ -433,6 +429,7 @@ server_send_deployment_reply(channel_t *channel,
}
channel_data.url = url;
channel_data.request_body = json_reply_string;
+ channel_data.format = CHANNEL_PARSE_NONE;
channel_data.method = CHANNEL_POST;
result = map_channel_retcode(channel->put(channel, (void *)&channel_data));
@@ -445,10 +442,6 @@ cleanup:
if (json_reply_string != NULL) {
free(json_reply_string);
}
- if (channel_data.json_reply != NULL &&
- json_object_put(channel_data.json_reply) != JSON_OBJECT_FREED) {
- ERROR("JSON object should be freed but was not.");
- }
return result;
}
Adapt suricatta modules to CHANNEL_PARSE_NONE instead of CHANNEL_PARSE_RAW where CHANNEL_PARSE_RAW was used but the response body actually not. Signed-off-by: Christian Storm <christian.storm@siemens.com> --- suricatta/server_general.c | 2 +- suricatta/server_hawkbit.c | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-)