libubus: refactor ubus_context msgbuf data to be dynamically allocated
[project/ubus.git] / libubus-req.c
index cdb8393..f24f033 100644 (file)
@@ -171,11 +171,12 @@ 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)
-               ubus_process_pending_msg(ctx);
+               if (ctx->stack_depth)
+                       ctx->pending_timer.cb(&ctx->pending_timer);
+       }
 
        return status;
 }