summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-04-11 14:15:55 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-04-11 14:15:55 +0200
commita274ae1502b257511298bd6a01cf1b7b69ade468 (patch)
treea57bf11a7d1bc7283bd3c53ce64d322bd803c1a7
parent772f4f02724ee81db96c9455be8afdb304603642 (diff)
Fix a crash on disconnection
Change-Id: Ib3654ac8125b040f8264524e7c821a6559f627cd Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-ws-json1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/afb-ws-json1.c b/src/afb-ws-json1.c
index 29078e26..9d560c5a 100644
--- a/src/afb-ws-json1.c
+++ b/src/afb-ws-json1.c
@@ -231,9 +231,10 @@ static struct json_object *wsreq_json(struct afb_wsreq *wsreq)
static void wsreq_reply(struct afb_wsreq *wsreq, int iserror, json_object *obj)
{
int rc;
+
rc = (iserror ? afb_wsj1_reply_error_j : afb_wsj1_reply_ok_j)(
wsreq->msgj1, obj, afb_context_sent_token(&wsreq->xreq.context));
if (rc)
- ERROR("Can't send reply: %m (was %s)", json_object_get_string(obj));
+ ERROR("Can't send reply: %m");
}