BUG/MINOR: stconn: Use HTX-aware channel's functions to get info on buffer

Some channel function are used to check if the channel's buffer is full, not
empty or if there are input data. However, functions used are not
HTX-aware. So it is not accurate and may prevent some actions to be
performed (However, not sure there are really issues). Because HTX-aware
versions now exist, use them instead.

This patch may be backported as far as 2.2. It relies on

    * "MINOR: channel: Add functions to get info on buffers and deal with HTX streams"
    * "MINOR: htx: Use a macro for overhead induced by HTX"
This commit is contained in:
Christopher Faulet 2023-11-17 11:59:33 +01:00
parent 24409a5caa
commit ab5ecaa2ea

View File

@ -1091,7 +1091,7 @@ static void sc_notify(struct stconn *sc)
*/
if (sc_ep_have_ff_data(sc_opposite(sc)) ||
(co_data(ic) && sc_ep_test(sco, SE_FL_WAIT_DATA) &&
(!(sc->flags & SC_FL_SND_EXP_MORE) || c_full(ic) || ci_data(ic) == 0))) {
(!(sc->flags & SC_FL_SND_EXP_MORE) || channel_full(ic, co_data(ic)) || channel_input_data(ic) == 0))) {
int new_len, last_len;
last_len = co_data(ic) + sc_ep_ff_data(sco);
@ -1275,7 +1275,7 @@ static int sc_conn_recv(struct stconn *sc)
*/
if ((global.tune.options & GTUNE_USE_ZERO_COPY_FWD) &&
sc_ep_test(sc, SE_FL_MAY_FASTFWD) && ic->to_forward) {
if (c_data(ic)) {
if (channel_data(ic)) {
/* We're embarrassed, there are already data pending in
* the buffer and we don't want to have them at two
* locations at a time. Let's indicate we need some