libubus: fix deferring invoke processing for non-uloop usage

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2014-06-24 22:42:14 +02:00
parent bbd3fbc9cc
commit 3869e0ca07
2 changed files with 7 additions and 2 deletions

View file

@ -171,9 +171,13 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req,
if (req->complete_cb)
req->complete_cb(req, status);
if (!registered)
if (!registered) {
uloop_fd_delete(&ctx->sock);
if (ctx->stack_depth)
ctx->pending_timer.cb(&ctx->pending_timer);
}
return status;
}

View file

@ -81,6 +81,7 @@ ubus_queue_msg(struct ubus_context *ctx, struct ubus_msghdr *hdr)
memcpy(&pending->hdr, hdr, sizeof(*hdr) + blob_raw_len(ubus_msghdr_data(hdr)));
list_add(&pending->list, &ctx->pending);
if (ctx->sock.registered)
uloop_timeout_set(&ctx->pending_timer, 1);
}