X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hreq.c;h=ab174e2fa23567ff9427eebb9d3526c11fbf3f72;hb=26bca5f8a8c6f9403a84945a5cd914b6da948efd;hp=4239670de8149a5b74ea09fb35972539096a277f;hpb=9d59db317f2ac51c3eb058fe740bd39b3021fbcd;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hreq.c b/src/afb-hreq.c index 4239670d..ab174e2f 100644 --- a/src/afb-hreq.c +++ b/src/afb-hreq.c @@ -677,7 +677,7 @@ static void req_send(struct afb_hreq *hreq, const char *buffer, size_t size) static ssize_t send_json_cb(json_object *obj, uint64_t pos, char *buf, size_t max) { - ssize_t len = stpncpy(buf, json_object_to_json_string(obj)+pos, max) - buf; + ssize_t len = stpncpy(buf, json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PLAIN)+pos, max) - buf; return len ? : (ssize_t)MHD_CONTENT_READER_END_OF_STREAM; } @@ -698,7 +698,7 @@ static void req_reply(struct afb_hreq *hreq, unsigned retcode, const char *statu if (reqid != NULL && json_object_object_get_ex(reply, "request", &request)) json_object_object_add (request, short_key_for_reqid, json_object_new_string(reqid)); - response = MHD_create_response_from_callback((uint64_t)strlen(json_object_to_json_string(reply)), SIZE_RESPONSE_BUFFER, (void*)send_json_cb, reply, (void*)json_object_put); + response = MHD_create_response_from_callback((uint64_t)strlen(json_object_to_json_string_ext(reply, JSON_C_TO_STRING_PLAIN)), SIZE_RESPONSE_BUFFER, (void*)send_json_cb, reply, (void*)json_object_put); afb_hreq_reply(hreq, retcode, response, NULL); }