libubus: fix deadlock in recursive synchronous ubus requests
[project/ubus.git] / libubus-req.c
index f02af8e..2f2dce1 100644 (file)
@@ -157,6 +157,8 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req,
                uloop_cancelled = cancelled;
        }
        ctx->stack_depth--;
+       if (ctx->stack_depth)
+               uloop_cancelled = true;
 
        if (timeout)
                uloop_timeout_cancel(&cb.timeout);