]> git.kaiwu.me - nginx.git/commit
HTTP/2: enforce writing the sync request body buffer to file.
authorValentin Bartenev <vbart@nginx.com>
Wed, 4 Oct 2017 18:15:15 +0000 (21:15 +0300)
committerValentin Bartenev <vbart@nginx.com>
Wed, 4 Oct 2017 18:15:15 +0000 (21:15 +0300)
commit328bfbe0d4653529362709920c388256c0a027e3
treead824d73ed85337cb41c4ac105902c7b171a00ec
parentd07d598c28205d30907d011f5d3a3d81a929787c
HTTP/2: enforce writing the sync request body buffer to file.

The sync flag of HTTP/2 request body buffer is used when the size of request
body is unknown or bigger than configured "client_body_buffer_size".  In this
case the buffer points to body data inside the global receive buffer that is
used for reading all HTTP/2 connections in the worker process.  Thus, when the
sync flag is set, the buffer must be flushed to a temporary file, otherwise
the request body data can be overwritten.

Previously, the sync buffer wasn't flushed to a temporary file if the whole
body was received in one DATA frame with the END_STREAM flag and wasn't
copied into the HTTP/2 body preread buffer.  As a result, the request body
might be corrupted (ticket #1384).

Now, setting r->request_body_in_file_only enforces writing the sync buffer
to a temporary file in all cases.
src/http/v2/ngx_http_v2.c