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.
This commit is contained in:
Willy Tarreau 2018-03-22 16:53:12 +01:00
parent 50791a7df3
commit d1023bbab3

View 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!