X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=libubus-req.c;h=db5061cad70887f15ab261154c51c732f2ea94ef;hp=3eeae40297fc042fc2132acecb16d431a14c4253;hb=6f4e11e1db399074273944329883f9c35e7daef6;hpb=d5fabacba1f701cab27bbee907d7c4a2ab74cb4d diff --git a/libubus-req.c b/libubus-req.c index 3eeae40..db5061c 100644 --- a/libubus-req.c +++ b/libubus-req.c @@ -140,15 +140,9 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req, int req_timeout) { ubus_complete_handler_t complete_cb = req->complete_cb; - bool registered = ctx->sock.registered; int status = UBUS_STATUS_NO_DATA; int64_t timeout = 0, time_end = 0; - if (!registered) { - uloop_init(); - ubus_add_uloop(ctx); - } - if (req_timeout) time_end = get_time_msec() + req_timeout; @@ -187,12 +181,8 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req, if (req->complete_cb) req->complete_cb(req, status); - if (!registered) { - uloop_fd_delete(&ctx->sock); - - if (!ctx->stack_depth) - ctx->pending_timer.cb(&ctx->pending_timer); - } + if (!ctx->stack_depth && !ctx->sock.registered) + ctx->pending_timer.cb(&ctx->pending_timer); return status; }