X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hreq.c;h=6b7d64be28ef02c7140d2b5f0534aa9895b3f699;hb=f262b0f726ac0577f40525038b779185f144873f;hp=c90b23725a05e042935e6d1c4ea2aa8f9321954b;hpb=34acb0f8d191593c9761e027424f13ae42831133;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hreq.c b/src/afb-hreq.c index c90b2372..6b7d64be 100644 --- a/src/afb-hreq.c +++ b/src/afb-hreq.c @@ -152,6 +152,10 @@ static void afb_hreq_reply_v(struct afb_hreq *hreq, unsigned status, struct MHD_ { char *cookie; const char *k, *v; + + if (hreq->replied != 0) + return; + k = va_arg(args, const char *); while (k != NULL) { v = va_arg(args, const char *); @@ -164,6 +168,14 @@ static void afb_hreq_reply_v(struct afb_hreq *hreq, unsigned status, struct MHD_ } MHD_queue_response(hreq->connection, status, response); MHD_destroy_response(response); + + hreq->replied = 1; + if (hreq->suspended != 0) { + extern void run_micro_httpd(struct afb_hsrv *hsrv); + MHD_resume_connection (hreq->connection); + hreq->suspended = 0; + run_micro_httpd(hreq->hsrv); + } } void afb_hreq_reply(struct afb_hreq *hreq, unsigned status, struct MHD_Response *response, ...)