MEDIUM: stream-int: fix the si_cant_put() calls used for buffer readiness

A number of calls to si_cant_put() were used in fact to request being
called back once a buffer is available. These ones are not needed anymore
since si_alloc_ibuf() already sets the SI_FL_RXBLK_BUFF flag when called
in appctx context. Those called with a foreign stream-int are simply turned
to si_rx_buff_blk().
This commit is contained in:
Willy Tarreau 2018-11-15 11:03:21 +01:00
parent 3367d4156d
commit 4b962a4179
4 changed files with 11 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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));
}

View File

@ -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;
}