diff --git a/proxy_luafgen.c b/proxy_luafgen.c index 78679a239..73c82b054 100644 --- a/proxy_luafgen.c +++ b/proxy_luafgen.c @@ -71,7 +71,7 @@ static void mcp_rcontext_cleanup(lua_State *L, mcp_funcgen_t *fgen, mcp_rcontext // cleanup of request queue entries. recurse funcgen cleanup. for (int x = 0; x < fgen->max_queues; x++) { struct mcp_rqueue_s *rqu = &rctx->qslots[x]; - if (rqu->obj_type == RQUEUE_TYPE_POOL) { + if (rqu->obj_type == RQUEUE_TYPE_POOL || rqu->obj_type == RQUEUE_TYPE_INT) { // nothing to do. } else if (rqu->obj_type == RQUEUE_TYPE_FGEN) { // don't need to recurse, just free the subrctx. @@ -1168,15 +1168,12 @@ void mcp_run_rcontext_handle(mcp_rcontext_t *rctx, int handle) { } else if (resp->io_pending) { resp->io_pending->return_cb = proxy_return_rqu_cb; // Add io object to extstore submission queue. - io_queue_t *q = conn_io_queue_get(rctx->c, IO_QUEUE_EXTSTORE); + io_queue_t *q = thread_io_queue_get(rctx->fgen->thread, IO_QUEUE_EXTSTORE); io_pending_proxy_t *io = (io_pending_proxy_t *)resp->io_pending; io->queue_handle = handle; io->client_resp = rqu->res_obj; - io->eio.next = q->stack_ctx; - q->stack_ctx = &io->eio; - assert(q->count >= 0); - q->count++; + STAILQ_INSERT_TAIL(&q->stack, (io_pending_t *)io, iop_next); io->rctx = rctx; io->c = rctx->c;