Browse Source

Document the set_options stream handler command

Loïc Hoguin 5 years ago
parent
commit
fad0ac8fb6

+ 6 - 0
doc/src/manual/cowboy_compress_h.asciidoc

@@ -37,11 +37,17 @@ compress_buffering (false)::
 Whether the output will be buffered. By default no
 Whether the output will be buffered. By default no
 buffering is done to provide maximum compatibility
 buffering is done to provide maximum compatibility
 at the cost of a lower compression rate.
 at the cost of a lower compression rate.
++
+This option can be updated at any time using the
+`set_options` stream handler command.
 
 
 compress_threshold (300)::
 compress_threshold (300)::
 
 
 How large the response body must be to be compressed
 How large the response body must be to be compressed
 when the response isn't streamed.
 when the response isn't streamed.
++
+This option can be updated at any time using the
+`set_options` stream handler command.
 
 
 == Events
 == Events
 
 

+ 6 - 0
doc/src/manual/cowboy_http.asciidoc

@@ -56,6 +56,9 @@ Whether chunked transfer-encoding is enabled for HTTP/1.1 connections.
 Note that a response streamed to the client without the chunked
 Note that a response streamed to the client without the chunked
 transfer-encoding and without a content-length header will result
 transfer-encoding and without a content-length header will result
 in the connection being closed at the end of the response body.
 in the connection being closed at the end of the response body.
++
+This option can be updated at any time using the
+`set_options` stream handler command.
 
 
 connection_type (supervisor)::
 connection_type (supervisor)::
 
 
@@ -68,6 +71,9 @@ Whether keep-alive is enabled for HTTP/1.0 connections.
 idle_timeout (60000)::
 idle_timeout (60000)::
 
 
 Time in ms with no data received before Cowboy closes the connection.
 Time in ms with no data received before Cowboy closes the connection.
++
+This option can be updated at any time using the
+`set_options` stream handler command.
 
 
 inactivity_timeout (300000)::
 inactivity_timeout (300000)::
 
 

+ 17 - 1
doc/src/manual/cowboy_stream.asciidoc

@@ -257,6 +257,22 @@ Log a message.
 This command can be used to log a message using the
 This command can be used to log a message using the
 configured `logger` module.
 configured `logger` module.
 
 
+=== set_options
+
+Set protocol options.
+
+[source,erlang]
+----
+{set_options, map()}
+----
+
+This can also be used to override stream handler
+options. For example this is supported by
+link:man:cowboy_compress_h(3)[cowboy_compress_h(3)].
+
+Not all options can be overriden. Please consult the
+relevant option's documentation for details.
+
 == Predefined events
 == Predefined events
 
 
 Cowboy will forward all messages sent to the stream to
 Cowboy will forward all messages sent to the stream to
@@ -377,7 +393,7 @@ tuple.
 
 
 == Changelog
 == Changelog
 
 
-* *2.7*: The `log` command was introduced.
+* *2.7*: The `log` and `set_options` commands were introduced.
 * *2.6*: The `data` command can now contain a sendfile tuple.
 * *2.6*: The `data` command can now contain a sendfile tuple.
 * *2.6*: The `{stop, {exit, any()}, HumanReadable}` terminate reason was added.
 * *2.6*: The `{stop, {exit, any()}, HumanReadable}` terminate reason was added.
 * *2.2*: The `trailers` command was introduced.
 * *2.2*: The `trailers` command was introduced.

+ 3 - 0
doc/src/manual/cowboy_websocket.asciidoc

@@ -232,6 +232,9 @@ idle_timeout (60000)::
 Time in milliseconds that Cowboy will keep the
 Time in milliseconds that Cowboy will keep the
 connection open without receiving anything from
 connection open without receiving anything from
 the client.
 the client.
++
+This option can be updated at any time using the
+`set_options` command.
 
 
 max_frame_size (infinity)::
 max_frame_size (infinity)::