Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
first add of asynchonous handling
[src/app-framework-binder.git]
/
src
/
afb-hreq.c
diff --git
a/src/afb-hreq.c
b/src/afb-hreq.c
index
c90b237
..
6b7d64b
100644
(file)
--- 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;
{
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 *);
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);
}
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, ...)
}
void afb_hreq_reply(struct afb_hreq *hreq, unsigned status, struct MHD_Response *response, ...)