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>
This commit is contained in:
parent
cd82f9758d
commit
6f4e11e1db
1 changed files with 2 additions and 11 deletions
|
@ -140,14 +140,9 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req,
|
||||||
int req_timeout)
|
int req_timeout)
|
||||||
{
|
{
|
||||||
ubus_complete_handler_t complete_cb = req->complete_cb;
|
ubus_complete_handler_t complete_cb = req->complete_cb;
|
||||||
bool registered = ctx->sock.registered;
|
|
||||||
int status = UBUS_STATUS_NO_DATA;
|
int status = UBUS_STATUS_NO_DATA;
|
||||||
int64_t timeout = 0, time_end = 0;
|
int64_t timeout = 0, time_end = 0;
|
||||||
|
|
||||||
if (!registered) {
|
|
||||||
ubus_add_uloop(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req_timeout)
|
if (req_timeout)
|
||||||
time_end = get_time_msec() + 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)
|
if (req->complete_cb)
|
||||||
req->complete_cb(req, status);
|
req->complete_cb(req, status);
|
||||||
|
|
||||||
if (!registered) {
|
if (!ctx->stack_depth && !ctx->sock.registered)
|
||||||
uloop_fd_delete(&ctx->sock);
|
ctx->pending_timer.cb(&ctx->pending_timer);
|
||||||
|
|
||||||
if (!ctx->stack_depth)
|
|
||||||
ctx->pending_timer.cb(&ctx->pending_timer);
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue