diff options
author | Loïc Hoguin <[email protected]> | 2019-10-09 20:54:33 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-10-09 20:54:33 +0200 |
commit | cc54c207e35f3ab7a2dfc105eef39fe7d3bf1633 (patch) | |
tree | c33b7e9398d2c4b4a1c1906e27383185673004df /doc/src/manual | |
parent | 0c4103984b28c9df1770a0eea0d14ba9cacc49e0 (diff) | |
download | cowboy-cc54c207e35f3ab7a2dfc105eef39fe7d3bf1633.tar.gz cowboy-cc54c207e35f3ab7a2dfc105eef39fe7d3bf1633.tar.bz2 cowboy-cc54c207e35f3ab7a2dfc105eef39fe7d3bf1633.zip |
Implement flow control for HTTP/1.1
We now stop reading from the socket unless asked to,
when we reach the request body. The option
initial_stream_flow_size controls how much data
we read without being asked, as an optimization.
We may also have received additional data along
with the request headers.
This commit also reworks the timeout handling for HTTP/1.1
because the stray timeout message was easily reproducible
after implementing the flow control. The issue should be
gone for good this time.
Diffstat (limited to 'doc/src/manual')
-rw-r--r-- | doc/src/manual/cowboy_http.asciidoc | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/doc/src/manual/cowboy_http.asciidoc b/doc/src/manual/cowboy_http.asciidoc index e9837c3..8d89ea2 100644 --- a/doc/src/manual/cowboy_http.asciidoc +++ b/doc/src/manual/cowboy_http.asciidoc @@ -17,25 +17,26 @@ as a Ranch protocol. [source,erlang] ---- opts() :: #{ - chunked => boolean(), - connection_type => worker | supervisor, - http10_keepalive => boolean(), - idle_timeout => timeout(), - inactivity_timeout => timeout(), - linger_timeout => timeout(), - logger => module(), - max_empty_lines => non_neg_integer(), - max_header_name_length => non_neg_integer(), - max_header_value_length => non_neg_integer(), - max_headers => non_neg_integer(), - max_keepalive => non_neg_integer(), - max_method_length => non_neg_integer(), - max_request_line_length => non_neg_integer(), - max_skip_body_length => non_neg_integer(), - proxy_header => boolean(), - request_timeout => timeout(), - sendfile => boolean(), - stream_handlers => [module()] + chunked => boolean(), + connection_type => worker | supervisor, + http10_keepalive => boolean(), + idle_timeout => timeout(), + inactivity_timeout => timeout(), + initial_stream_flow_size => non_neg_integer(), + linger_timeout => timeout(), + logger => module(), + max_empty_lines => non_neg_integer(), + max_header_name_length => non_neg_integer(), + max_header_value_length => non_neg_integer(), + max_headers => non_neg_integer(), + max_keepalive => non_neg_integer(), + max_method_length => non_neg_integer(), + max_request_line_length => non_neg_integer(), + max_skip_body_length => non_neg_integer(), + proxy_header => boolean(), + request_timeout => timeout(), + sendfile => boolean(), + stream_handlers => [module()] } ---- @@ -79,6 +80,12 @@ inactivity_timeout (300000):: Time in ms with nothing received at all before Cowboy closes the connection. +initial_stream_flow_size (65535):: + +Amount of data in bytes Cowboy will read from the socket +right after a request was fully received. This is a soft +limit. + linger_timeout (1000):: Time in ms that Cowboy will wait when closing the connection. This is @@ -144,7 +151,7 @@ Ordered list of stream handlers that will handle all stream events. == Changelog -* *2.7*: The `logger` option was added. +* *2.7*: The `initial_stream_flow_size` and `logger` options were added. * *2.6*: The `chunked`, `http10_keepalive`, `proxy_header` and `sendfile` options were added. * *2.5*: The `linger_timeout` option was added. * *2.2*: The `max_skip_body_length` option was added. |