X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=libubus-req.c;h=416adaba2f9fca50225d9915b2512026a7b481f1;hp=2197f2a9fdd997183a3f641653be5e071d5af478;hb=635ada42517f2fd79663a2a45f07c9461f6d20bc;hpb=2d660c519d2fcff95248da9f4fd9b37d61f9eb09 diff --git a/libubus-req.c b/libubus-req.c index 2197f2a..416adab 100644 --- a/libubus-req.c +++ b/libubus-req.c @@ -160,6 +160,10 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req, ubus_poll_data(ctx, (unsigned int) timeout); uloop_cancelled = cancelled; + if (ctx->sock.eof) { + ubus_set_req_status(req, UBUS_STATUS_CONNECTION_FAILED); + break; + } } ctx->stack_depth--; if (ctx->stack_depth) @@ -466,3 +470,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); +}