int cli_io_handler_show_ring(struct appctx *appctx)
{
struct show_ring_ctx *ctx = appctx->svcctx;
- struct stconn *sc = appctx_sc(appctx);
struct ring *ring = ctx->ring;
size_t last_ofs;
size_t ofs;
/* we've drained everything and are configured to wait for more
* data or an event (keypress, close)
*/
- if (!sc_oc(sc)->output && !(sc->flags & SC_FL_SHUT_DONE)) {
+ if (!b_data(&appctx->inbuf)) {
/* let's be woken up once new data arrive */
MT_LIST_APPEND(&ring->waiters, &appctx->wait_entry);
ofs = ring_tail(ring);
ret = 0;
}
/* always drain all the request */
- co_skip(sc_oc(sc), sc_oc(sc)->output);
+ b_reset(&appctx->inbuf);
+ applet_fl_clr(appctx, APPCTX_FL_INBLK_FULL);
}
+ applet_will_consume(appctx);
applet_expect_no_data(appctx);
return ret;
}