summaryrefslogtreecommitdiff
path: root/libubus.c
diff options
context:
space:
mode:
Diffstat (limited to 'libubus.c')
-rw-r--r--libubus.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libubus.c b/libubus.c
index 846ae83..b405891 100644
--- a/libubus.c
+++ b/libubus.c
@@ -115,10 +115,12 @@ ubus_process_msg(struct ubus_context *ctx, struct ubus_msghdr_buf *buf, int fd)
static void ubus_process_pending_msg(struct uloop_timeout *timeout)
{
struct ubus_context *ctx = container_of(timeout, struct ubus_context, pending_timer);
- struct ubus_pending_msg *pending;
+ struct ubus_pending_msg *pending, *tmp;
+
+ list_for_each_entry_safe(pending, tmp, &ctx->pending, list) {
+ if (ctx->stack_depth)
+ break;
- while (!ctx->stack_depth && !list_empty(&ctx->pending)) {
- pending = list_first_entry(&ctx->pending, struct ubus_pending_msg, list);
list_del(&pending->list);
ubus_process_msg(ctx, &pending->hdr, -1);
free(pending);