summaryrefslogtreecommitdiffstats
path: root/src/afb-hreq.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-09-22 16:24:24 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-10-09 14:08:33 +0200
commit7a7268a5697b0b988bcabc00390878edee941b4e (patch)
treec64c412c342d33d01d7cb5a7bf3c00c55ad31055 /src/afb-hreq.c
parent4a6490b96d8ac2da6a19b4f251c005ff1b1e7d61 (diff)
Provide API and VERB name of requests
Change-Id: I9a86c6314f871334231e50f9cea60b54aed434b9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-hreq.c')
-rw-r--r--src/afb-hreq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/afb-hreq.c b/src/afb-hreq.c
index db804eb2..cdc9f239 100644
--- a/src/afb-hreq.c
+++ b/src/afb-hreq.c
@@ -316,8 +316,8 @@ static void req_destroy(struct afb_xreq *xreq)
}
afb_context_disconnect(&hreq->xreq.context);
json_object_put(hreq->json);
- free((char*)hreq->xreq.api);
- free((char*)hreq->xreq.verb);
+ free((char*)hreq->xreq.request.api);
+ free((char*)hreq->xreq.request.verb);
afb_cred_unref(hreq->xreq.cred);
free(hreq);
}
@@ -914,9 +914,9 @@ static void req_success(struct afb_xreq *xreq, json_object *obj, const char *inf
void afb_hreq_call(struct afb_hreq *hreq, struct afb_apiset *apiset, const char *api, size_t lenapi, const char *verb, size_t lenverb)
{
- hreq->xreq.api = strndup(api, lenapi);
- hreq->xreq.verb = strndup(verb, lenverb);
- if (hreq->xreq.api == NULL || hreq->xreq.verb == NULL) {
+ hreq->xreq.request.api = strndup(api, lenapi);
+ hreq->xreq.request.verb = strndup(verb, lenverb);
+ if (hreq->xreq.request.api == NULL || hreq->xreq.request.verb == NULL) {
ERROR("Out of memory");
afb_hreq_reply_error(hreq, MHD_HTTP_INTERNAL_SERVER_ERROR);
} else if (afb_hreq_init_context(hreq) < 0) {