diff options
| author | Valentin Bartenev <vbart@nginx.com> | 2016-05-24 17:37:52 +0300 |
|---|---|---|
| committer | Valentin Bartenev <vbart@nginx.com> | 2016-05-24 17:37:52 +0300 |
| commit | 5429140c018726e8b28c724b06daaf0fe33d2205 (patch) | |
| tree | a4472f68dd62a8f30acc7df95a450e5e9515b861 /src/http/v2/ngx_http_v2_module.h | |
| parent | adfd0b065cca23d2ca61ad43c5b8fdaa23957da9 (diff) | |
| download | nginx-5429140c018726e8b28c724b06daaf0fe33d2205.tar.gz nginx-5429140c018726e8b28c724b06daaf0fe33d2205.tar.bz2 | |
HTTP/2: implemented preread buffer for request body (closes #959).
Previously, the stream's window was kept zero in order to prevent a client
from sending the request body before it was requested (see 887cca40ba6a for
details). Until such initial window was acknowledged all requests with
data were rejected (see 0aa07850922f for details).
That approach revealed a number of problems:
1. Some clients (notably MS IE/Edge, Safari, iOS applications) show an error
or even crash if a stream is rejected;
2. This requires at least one RTT for every request with body before the
client receives window update and able to send data.
To overcome these problems the new directive "http2_body_preread_size" is
introduced. It sets the initial window and configures a special per stream
preread buffer that is used to save all incoming data before the body is
requested and processed.
If the directive's value is lower than the default initial window (65535),
as previously, all streams with data will be rejected until the new window
is acknowledged. Otherwise, no special processing is used and all requests
with data are welcome right from the connection start.
The default value is chosen to be 64k, which is bigger than the default
initial window. Setting it to zero is fully complaint to the previous
behavior.
Diffstat (limited to 'src/http/v2/ngx_http_v2_module.h')
| -rw-r--r-- | src/http/v2/ngx_http_v2_module.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/v2/ngx_http_v2_module.h b/src/http/v2/ngx_http_v2_module.h index 95cc7d86f..91f97c253 100644 --- a/src/http/v2/ngx_http_v2_module.h +++ b/src/http/v2/ngx_http_v2_module.h @@ -25,6 +25,7 @@ typedef struct { ngx_uint_t concurrent_streams; size_t max_field_size; size_t max_header_size; + size_t preread_size; ngx_uint_t streams_index_mask; ngx_msec_t recv_timeout; ngx_msec_t idle_timeout; |
