From 90c92850b7efa54933a6a1e42ce0c71bb5bb99e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 29 Sep 2012 13:24:40 +0200 Subject: Add missing options in the cowboy_protocol documentation --- src/cowboy_protocol.erl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/cowboy_protocol.erl') diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl index a9ce69c..71632ae 100644 --- a/src/cowboy_protocol.erl +++ b/src/cowboy_protocol.erl @@ -20,6 +20,19 @@ %%
dispatch
The dispatch list for this protocol.
%%
max_empty_lines
Max number of empty lines before a request. %% Defaults to 5.
+%%
max_header_name_length
Max length allowed for header names. +%% Defaults to 64.
+%%
max_header_value_length
Max length allowed for header values. +%% Defaults to 4096.
+%%
max_keepalive
Max number of requests allowed in a single +%% keep-alive session. Defaults to infinity.
+%%
max_request_line_length
Max length allowed for the request +%% line. Defaults to 4096.
+%%
onrequest
Optional fun that allows Req interaction before +%% any dispatching is done. Host info, path info and bindings are thus +%% not available at this point.
+%%
onresponse
Optional fun that allows replacing a response +%% sent by the application based on its status code or headers.
%%
timeout
Time in milliseconds before an idle %% connection is closed. Defaults to 5000 milliseconds.
%% @@ -88,10 +101,10 @@ get_value(Key, Opts, Default) -> init(ListenerPid, Socket, Transport, Opts) -> Dispatch = get_value(dispatch, Opts, []), MaxEmptyLines = get_value(max_empty_lines, Opts, 5), - MaxKeepalive = get_value(max_keepalive, Opts, infinity), - MaxRequestLineLength = get_value(max_request_line_length, Opts, 4096), MaxHeaderNameLength = get_value(max_header_name_length, Opts, 64), MaxHeaderValueLength = get_value(max_header_value_length, Opts, 4096), + MaxKeepalive = get_value(max_keepalive, Opts, infinity), + MaxRequestLineLength = get_value(max_request_line_length, Opts, 4096), OnRequest = get_value(onrequest, Opts, undefined), OnResponse = get_value(onresponse, Opts, undefined), Timeout = get_value(timeout, Opts, 5000), @@ -531,6 +544,7 @@ handler_loop_timeout(State=#state{loop_timeout=Timeout, TRef = erlang:start_timer(Timeout, self(), ?MODULE), State#state{loop_timeout_ref=TRef}. +%% @private -spec handler_loop(cowboy_req:req(), #state{}, module(), any()) -> ok. handler_loop(Req, State=#state{loop_timeout_ref=TRef}, Handler, HandlerState) -> receive -- cgit v1.2.3