summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-08-10 11:43:10 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-08-10 11:47:41 +0200
commit38dab18424804033b160a2bacc1afc68325359e4 (patch)
treeb84a4bf82248ce05a0c38e5dc5ea4c436b80027b
parent49c8a9b7e8d129a42e5e2ca9a0497a4a98bbb72d (diff)
afb-xreq: handle when no reply was sent
Send an error reply if no reply was sent. Change-Id: Ibc5c98d22b9820f1f0b5370083f79a52213ddc61 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-xreq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/afb-xreq.c b/src/afb-xreq.c
index c70e0006..80dd143d 100644
--- a/src/afb-xreq.c
+++ b/src/afb-xreq.c
@@ -49,6 +49,8 @@ static inline void xreq_addref(struct afb_xreq *xreq)
static inline void xreq_unref(struct afb_xreq *xreq)
{
if (!__atomic_sub_fetch(&xreq->refcount, 1, __ATOMIC_RELAXED)) {
+ if (!xreq->replied)
+ afb_xreq_fail(xreq, "error", "no reply");
if (xreq->hookflags)
afb_hook_xreq_end(xreq);
xreq->queryitf->unref(xreq);