ubusd: make ACL path configurable on the command line
[project/ubus.git] / libubus-req.c
index d44db51..bf19f36 100644 (file)
@@ -175,7 +175,7 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req,
        if (!registered) {
                uloop_fd_delete(&ctx->sock);
 
-               if (ctx->stack_depth)
+               if (!ctx->stack_depth)
                        ctx->pending_timer.cb(&ctx->pending_timer);
        }
 
@@ -466,3 +466,9 @@ void __hidden ubus_process_req_msg(struct ubus_context *ctx, struct ubus_msghdr_
                break;
        }
 }
+
+int __ubus_monitor(struct ubus_context *ctx, const char *type)
+{
+       blob_buf_init(&b, 0);
+       return ubus_invoke(ctx, UBUS_SYSTEM_OBJECT_MONITOR, type, b.head, NULL, NULL, 1000);
+}