X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-ws-json1.c;h=88f9b358fe6e2cdea3e971bea9ae7978b95c23de;hb=26bca5f8a8c6f9403a84945a5cd914b6da948efd;hp=78b8c2100cdd63c5c6f953e17f2772f1b2d02fba;hpb=28158192742ead144454e071720d10bf5218a20b;p=src%2Fapp-framework-binder.git diff --git a/src/afb-ws-json1.c b/src/afb-ws-json1.c index 78b8c210..88f9b358 100644 --- a/src/afb-ws-json1.c +++ b/src/afb-ws-json1.c @@ -129,6 +129,10 @@ static void aws_on_hangup(struct afb_ws_json1 *ws) struct afb_wsreq { + /* + * CAUTION: 'context' field should be the first because there + * is an implicit convertion to struct afb_context + */ struct afb_context context; int refcount; struct afb_ws_json1 *aws; @@ -169,7 +173,9 @@ static const struct afb_req_itf wsreq_itf = { .context_get = (void*)afb_context_get, .context_set = (void*)afb_context_set, .addref = (void*)wsreq_addref, - .unref = (void*)wsreq_unref + .unref = (void*)wsreq_unref, + .session_close = (void*)afb_context_close, + .session_set_LOA = (void*)afb_context_change_loa }; static int aws_wsreq_parse(struct afb_wsreq *r, char *text, size_t size) @@ -410,7 +416,7 @@ static void aws_emit(struct afb_ws_json1 *aws, int code, const char *id, size_t json_object_array_add(msg, json_object_new_string(token)); /* emits the reply */ - txt = json_object_to_json_string(msg); + txt = json_object_to_json_string_ext(msg, JSON_C_TO_STRING_PLAIN); afb_ws_text(aws->ws, txt, strlen(txt)); json_object_put(msg); }