BUG/MINOR: mux-h2: properly ignore R bit in WINDOW_UPDATE increments

The window size increments are 31 bits and the topmost bit is reserved
and should be ignored, however it was not masked, so a peer sending it
set would emit a negative value which could actually reduce the current
window instead of increasing it. Note that the window cannot reach zero
as there's already a test for this, but transfers could slow down to
the same speed as if an initial window of just a few bytes had been
advertised. Let's just mask the reserved bit before processing.

This should be backported to all stable versions.
This commit is contained in:
Willy Tarreau 2026-03-19 07:21:47 +01:00
parent 0e231bbd7c
commit e31640368a

View File

@ -3289,7 +3289,7 @@ static int h2c_handle_window_update(struct h2c *h2c, struct h2s *h2s)
goto out0;
}
inc = h2_get_n32(&h2c->dbuf, 0);
inc = h2_get_n32(&h2c->dbuf, 0) & 0x7FFFFFFF;
if (h2c->dsi != 0) {
/* stream window update */