]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: properly account for DATA padding in flow control
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Mar 2018 15:53:12 +0000 (16:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Mar 2018 15:53:12 +0000 (16:53 +0100)
Recent fixes made to process partial frames broke the flow control on
DATA frames, as the padding is not considered anymore, only the actual
data is. Let's simply take account of the padding once the transfer
ends. The probability to meet this bug is low because, when used, padding
is small and it can require a large number of padded transfers before the
window is completely depleted.

Thanks to user klzgrad for reporting this bug and confirming the fix.

This fix must be backported to 1.8.

src/mux_h2.c

index ebefd5200ae2d9f55c2b65936c4ae99a6bf50a54..d15b0e33b797d1569df6de79a70ca37b86c07a96 100644 (file)
@@ -2788,6 +2788,9 @@ static int h2_frt_transfer_data(struct h2s *h2s, struct buffer *buf, int count)
        /* here we're done with the frame, all the payload (except padding) was
         * transferred.
         */
+       h2c->rcvd_c += h2c->dpl;
+       h2c->rcvd_s += h2c->dpl;
+       h2c->dpl = 0;
        h2c->st0 = H2_CS_FRAME_A; // send the corresponding window update
 
        /* don't send it before returning data!