Add credential data to xreq
[src/app-framework-binder.git] / src / main.c
index 4dc6cb8..6684ed5 100644 (file)
@@ -44,6 +44,7 @@
 #include "afb-context.h"
 #include "afb-hreq.h"
 #include "afb-xreq.h"
+#include "afb-cred.h"
 #include "jobs.h"
 #include "afb-session.h"
 #include "verbose.h"
@@ -467,6 +468,7 @@ static void startup_call_unref(struct afb_xreq *xreq)
        free(sreq->api);
        free(sreq->verb);
        json_object_put(sreq->xreq.json);
+       afb_cred_unref(sreq->xreq.cred);
        sreq->current = sreq->current->next;
        if (sreq->current)
                startup_call_current(sreq);
@@ -496,6 +498,7 @@ static void startup_call_current(struct startup_req *sreq)
                        afb_xreq_init(&sreq->xreq, &startup_xreq_itf);
                        afb_context_init(&sreq->xreq.context, sreq->session, NULL);
                        sreq->xreq.context.validated = 1;
+                       sreq->xreq.cred = afb_cred_current();
                        sreq->api = strndup(api, verb - api);
                        sreq->verb = strndup(verb + 1, json - verb - 1);
                        sreq->xreq.api = sreq->api;