]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: stop sending using HTX on errors
authorWilly Tarreau <w@1wt.eu>
Thu, 6 Dec 2018 13:09:09 +0000 (14:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Dec 2018 13:09:09 +0000 (14:09 +0100)
We didn't take care of the stream error in the HTX send loop, causing
some errors (like buffer full) to provoke 100% CPU.

No backport is needed.

src/mux_h2.c

index 0eb5fd21b83eee02c98136708764aeaa72c39b1d..06ee7d798a3dcd77a364062ed52772c9fd2a9411 100644 (file)
@@ -4612,7 +4612,8 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
        }
 
        if (htx) {
-               while (!(h2s->flags & H2_SF_BLK_ANY) && count && !htx_is_empty(htx)) {
+               while (h2s->st < H2_SS_ERROR && !(h2s->flags & H2_SF_BLK_ANY) &&
+                      count && !htx_is_empty(htx)) {
                        idx   = htx_get_head(htx);
                        blk   = htx_get_blk(htx, idx);
                        btype = htx_get_blk_type(blk);