]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: set the stream-full flag when leaving h2c_decode_headers()
authorWilly Tarreau <w@1wt.eu>
Thu, 3 Jan 2019 07:52:09 +0000 (08:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 3 Jan 2019 08:28:59 +0000 (09:28 +0100)
If we exit this function because some data are pending in the rxbuf, we
currently don't indicate any blocking flag, which will prevent the operation
from being attempted again. Let's set H2_CF_DEM_SFULL in this case to indicate
there's not enough room in the stream buffer so that the operation may be
attempted again once we make room. It seems that this issue cannot be
triggered right now but it definitely will with trailers.

This fix should be backported to 1.9 for completeness.

src/mux_h2.c

index c15922557336bf460b297350b7646dc6593bad6c..cbfc8309c02d35f4593dccc353ce082e68548b8b 100644 (file)
@@ -3314,11 +3314,15 @@ next_frame:
 
        if (h2c->proxy->options2 & PR_O2_USE_HTX) {
                htx = htx_from_buf(rxbuf);
-               if (!htx_is_empty(htx))
+               if (!htx_is_empty(htx)) {
+                       h2c->flags |= H2_CF_DEM_SFULL;
                        goto fail;
+               }
        } else {
-               if (b_data(rxbuf))
+               if (b_data(rxbuf)) {
+                       h2c->flags |= H2_CF_DEM_SFULL;
                        goto fail;
+               }
 
                rxbuf->head = 0;
                try = b_size(rxbuf);