X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-stub-ws.c;h=eab897b0ad1a7d0e61251b394a9e62c4a5289726;hb=3922f07ae1eda1de5d84832c25197296d1c10311;hp=7ec2d63d1243b636cf6999dd82f4de265af3875f;hpb=77bf8a30c07a4ab5690337ed362dae4414e590fb;p=src%2Fapp-framework-binder.git diff --git a/src/afb-stub-ws.c b/src/afb-stub-ws.c index 7ec2d63d..eab897b0 100644 --- a/src/afb-stub-ws.c +++ b/src/afb-stub-ws.c @@ -266,6 +266,7 @@ static void client_api_call_cb(void * closure, struct afb_xreq *xreq) return; } + afb_xreq_unhooked_addref(xreq); rc = afb_proto_ws_client_call( proto, xreq->request.called_verb, @@ -273,10 +274,10 @@ static void client_api_call_cb(void * closure, struct afb_xreq *xreq) afb_session_uuid(xreq->context.session), xreq, xreq_on_behalf_cred_export(xreq)); - if (rc >= 0) - afb_xreq_unhooked_addref(xreq); - else + if (rc < 0) { afb_xreq_reply(xreq, NULL, "internal", "can't send message"); + afb_xreq_unhooked_unref(xreq); + } } static void client_on_description_cb(void *closure, struct json_object *data) @@ -648,7 +649,7 @@ static void on_hangup(void *closure) static int enqueue_processing(struct afb_proto_ws *proto, void (*callback)(int signum, void* arg), void *arg) { - return jobs_queue(proto, 0, callback, arg); + return jobs_queue(NULL /* proto */, 0, callback, arg); } /*****************************************************/