From: Willy Tarreau Date: Thu, 22 Mar 2018 15:53:12 +0000 (+0100) Subject: BUG/MEDIUM: h2: properly account for DATA padding in flow control X-Git-Tag: v1.9-dev1~351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1023bbab3985091a9968192bb984d7724a438a3;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: h2: properly account for DATA padding in flow control 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. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index ebefd5200a..d15b0e33b7 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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!