]> git.kaiwu.me - nginx.git/commit
HTTP/2: fixed window updates when buffering in filters.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Sep 2021 11:54:47 +0000 (14:54 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Sep 2021 11:54:47 +0000 (14:54 +0300)
commit27fb6cdb9f7aa9d6258251d565b199e2a15f5286
tree2d6ac4e9372bc00155526cc593c0b5cf329af0a3
parent16557ff8b611748e463ff951d6931fb60d9b78f1
HTTP/2: fixed window updates when buffering in filters.

In the body read handler, the window was incorrectly calculated
based on the full buffer size instead of the amount of free space
in the buffer.  If the request body is buffered by a filter, and
the buffer is not empty after the read event is generated by the
filter to resume request body processing, this could result in
"http2 negative window update" alerts.

Further, in the body ready handler and in ngx_http_v2_state_read_data()
the buffer wasn't cleared when the data were already written to disk,
so the client might stuck without window updates.
src/http/v2/ngx_http_v2.c