X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hreq.c;h=4ca8441e280ca0de6a9c074cd0421a617104ec5f;hb=b57505f0f80f6394f04a041df6e808c857b01d4b;hp=5f9ca5108cea69d459d232f64c5ad438403cc1f1;hpb=cee4240979b3b9c4ebb877631e66157918598c3d;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hreq.c b/src/afb-hreq.c index 5f9ca510..4ca8441e 100644 --- a/src/afb-hreq.c +++ b/src/afb-hreq.c @@ -774,20 +774,15 @@ static ssize_t send_json_cb(json_object *obj, uint64_t pos, char *buf, size_t ma static void req_reply(struct afb_hreq *hreq, unsigned retcode, const char *status, const char *info, json_object *resp) { - struct json_object *reply, *request; - const char *token, *uuid, *reqid; + struct json_object *reply; + const char *reqid; struct MHD_Response *response; - token = afb_context_sent_token(&hreq->context); - uuid = afb_context_sent_uuid(&hreq->context); - - reply = afb_msg_json_reply(status, info, resp, token, uuid); - reqid = afb_hreq_get_argument(hreq, long_key_for_reqid); if (reqid == NULL) reqid = afb_hreq_get_argument(hreq, short_key_for_reqid); - 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)); + + reply = afb_msg_json_reply(status, info, resp, &hreq->context, reqid); 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);