X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hreq.c;h=4d5f659c24a369ca5f98a956cd00f80a7b78ca87;hb=b4da3b7f3db2211e7ecca74301e26b3089fda5a2;hp=6440a8cd2798b055c950ffc0f73b39201a920fc2;hpb=e6908a2ee7b645517c062f2fd0419fcb3f4f976e;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hreq.c b/src/afb-hreq.c index 6440a8cd..4d5f659c 100644 --- a/src/afb-hreq.c +++ b/src/afb-hreq.c @@ -43,6 +43,7 @@ #include "afb-hsrv.h" #include "afb-session.h" #include "afb-cred.h" +#include "afb-token.h" #include "verbose.h" #include "locale-root.h" @@ -166,7 +167,8 @@ static void afb_hreq_reply_v(struct afb_hreq *hreq, unsigned status, struct MHD_ MHD_add_response_header(response, k, v); k = va_arg(args, const char *); } - v = afb_context_sent_uuid(&hreq->xreq.context); + + v = afb_context_uuid(&hreq->xreq.context); if (v != NULL && asprintf(&cookie, cookie_setter, v) > 0) { MHD_add_response_header(response, MHD_HTTP_HEADER_SET_COOKIE, cookie); free(cookie); @@ -965,6 +967,7 @@ int afb_hreq_init_context(struct afb_hreq *hreq) { const char *uuid; const char *token; + struct afb_token *tok; if (hreq->xreq.context.session != NULL) return 0; @@ -993,8 +996,11 @@ int afb_hreq_init_context(struct afb_hreq *hreq) } } } + tok = NULL; + if (token) + afb_token_get(&tok, token); - return afb_context_connect(&hreq->xreq.context, uuid, token); + return afb_context_connect(&hreq->xreq.context, uuid, tok); } int afb_hreq_init_cookie(int port, const char *path, int maxage)