diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-01-22 14:33:37 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-01-22 14:39:34 +0100 |
commit | 6f4e11e1db399074273944329883f9c35e7daef6 (patch) | |
tree | 7a63e2106e254fb6925f81ad018cd180fd0a5a5e | |
parent | cd82f9758dd6da37fb11f2992ceb66d3ee99bac0 (diff) | |
download | ubus-6f4e11e1db399074273944329883f9c35e7daef6.tar.gz |
libubus: do not register/unregister with uloop during sync requests
This was leftover code from before this codepath was converted to
polling directly
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | libubus-req.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/libubus-req.c b/libubus-req.c index 5dcd470..db5061c 100644 --- a/libubus-req.c +++ b/libubus-req.c @@ -140,14 +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) { - ubus_add_uloop(ctx); - } - if (req_timeout) time_end = get_time_msec() + req_timeout; @@ -186,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; } |