From: Christopher Faulet Date: Fri, 13 Jan 2023 10:28:31 +0000 (+0100) Subject: BUG/MEDIUM: mux-h2: Don't send CANCEL on shutw when response length is unkown X-Git-Tag: v2.8-dev2~39 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=462f52260c0685696b1521ef9e5276b98ba98cde;p=haproxy-3.0.git BUG/MEDIUM: mux-h2: Don't send CANCEL on shutw when response length is unkown Since commit 473e0e54 ("BUG/MINOR: mux-h2: send a CANCEL instead of ES on truncated writes"), a CANCEL may be reported when the response length is unkown. It happens for H1 reponses without "Content-lenght" or "Transfer-encoding" header. Indeed, in this case, the end of the reponse is detected when the server connection is closed. On the fontend side, the H2 multiplexer handles this event as an abort and sensd a RST_STREAM frame with CANCEL error code. The issue is not with the above commit but with the commit 4877045f1 ("MINOR: mux-h2: make streams know if they need to send more data"). The H2_SF_MORE_HTX_DATA flag must only be set if the payload length can be determined. This patch should fix the issue #1992. It must be backported to 2.7. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 22b1f1e..4c29a28 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6356,7 +6356,7 @@ static size_t h2_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, in if (!(h2s->flags & H2_SF_OUTGOING_DATA) && count) h2s->flags |= H2_SF_OUTGOING_DATA; - if (htx->extra) + if (htx->extra && htx->extra != ULLONG_MAX) h2s->flags |= H2_SF_MORE_HTX_DATA; else h2s->flags &= ~H2_SF_MORE_HTX_DATA;