Hi,
On Wed, Jan 24, 2018 at 12:13:07PM +0800, klzgrad wrote:
> Hi,
>
> I think I found a new issue while inspecting the source code.
>
> In h2_frt_transfer_data(), the paddings are not added to the
> connection and stream flow control counters, h2c->rcvd_c and
> h2c->rcvd_s. But it should, per RFC 7540 6.1:
>
> > The entire DATA frame payload is included in flow control, including the
> > Pad Length and Padding fields if present.
You're right, I think I broke it when modifying the DATA frames parser
to handle partial frames recently :-(
Does the attached patch fix the problem for you ?
Please note that it will not address your other issue (lack of accounting
of DATA frames subject to an RST) though, it will require a bit more work
to avoid breaking what currently works.
Thanks,
Willy
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 7bb51ea..4196e75 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -2821,6 +2821,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!