From a2efb09440814063cf6472b7111ff72c4582f1b2 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Thu, 10 Aug 2017 11:43:10 +0200 Subject: afb-xreq: handle when no reply was sent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Send an error reply if no reply was sent. Change-Id: Ibc5c98d22b9820f1f0b5370083f79a52213ddc61 Signed-off-by: José Bollo --- src/afb-xreq.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- cgit 1.2.3-korg