diff --git a/src/cache.c b/src/cache.c index 35568bc55..fdb0f256f 100644 --- a/src/cache.c +++ b/src/cache.c @@ -644,7 +644,9 @@ static void http_cache_io_handler(struct appctx *appctx) /* Check if the input buffer is avalaible. */ if (res->buf.size == 0) { - si_cant_put(si); + /* buf.size==0 means we failed to get a buffer and were + * already subscribed to a wait list to get a buffer. + */ goto out; } diff --git a/src/cli.c b/src/cli.c index 720a9b451..6329db1ce 100644 --- a/src/cli.c +++ b/src/cli.c @@ -550,7 +550,9 @@ static void cli_io_handler(struct appctx *appctx) /* Check if the input buffer is avalaible. */ if (res->buf.size == 0) { - si_cant_put(si); + /* buf.size==0 means we failed to get a buffer and were + * already subscribed to a wait list to get a buffer. + */ goto out; } diff --git a/src/hlua.c b/src/hlua.c index ad0f9f92e..f7d271886 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -2942,7 +2942,7 @@ __LJMP static int hlua_channel_append_yield(lua_State *L, int status, lua_KConte * the request buffer if its not required. */ if (chn->buf.size == 0) { - si_cant_put(chn_prod(chn)); + si_rx_buff_blk(chn_prod(chn)); MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_channel_append_yield, TICK_ETERNITY, 0)); } @@ -3036,7 +3036,7 @@ __LJMP static int hlua_channel_send_yield(lua_State *L, int status, lua_KContext * the request buffer if its not required. */ if (chn->buf.size == 0) { - si_cant_put(chn_prod(chn)); + si_rx_buff_blk(chn_prod(chn)); MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_channel_send_yield, TICK_ETERNITY, 0)); } diff --git a/src/stats.c b/src/stats.c index 0574260d9..31c4f8540 100644 --- a/src/stats.c +++ b/src/stats.c @@ -3049,7 +3049,9 @@ static void http_stats_io_handler(struct appctx *appctx) /* Check if the input buffer is avalaible. */ if (res->buf.size == 0) { - si_cant_put(si); + /* already subscribed, we'll be called later once the buffer is + * available. + */ goto out; }