aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-08-21 14:31:41 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-08-23 08:35:38 +0200
commit9490a0a5fe69f54aa30c4f75a79acde9d06a80f1 (patch)
tree48ebe275018eda1d90d0ac2cccb546f1b1fe8993
parente36f8d572ca660f5c06fe45297d13c7a6818cc65 (diff)
afb-stub-ws: Process error on call to remote
Change-Id: I8bb96419cfac3da88e75da42c66a5d359ec7c666 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-stub-ws.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/afb-stub-ws.c b/src/afb-stub-ws.c
index ae83e534..5000f9f9 100644
--- a/src/afb-stub-ws.c
+++ b/src/afb-stub-ws.c
@@ -210,16 +210,20 @@ static struct client_event *client_event_search(struct afb_stub_ws *stubws, uint
/* on call, propagate it to the ws service */
static void client_call_cb(void * closure, struct afb_xreq *xreq)
{
+ int rc;
struct afb_stub_ws *stubws = closure;
- afb_proto_ws_client_call(
+ rc = afb_proto_ws_client_call(
stubws->proto,
xreq->request.called_verb,
afb_xreq_json(xreq),
afb_session_uuid(xreq->context.session),
xreq,
xreq_on_behalf_cred_export(xreq));
- afb_xreq_unhooked_addref(xreq);
+ if (rc >= 0)
+ afb_xreq_unhooked_addref(xreq);
+ else
+ afb_xreq_reply(xreq, NULL, "internal", "can't send message");
}
static void client_on_description_cb(void *closure, struct json_object *data)