mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
Forward transport and protocol name to Handler:init.
This commit is contained in:
parent
e0185dd27f
commit
7888be00d2
2 changed files with 5 additions and 4 deletions
|
@ -130,8 +130,9 @@ header(http_eoh, Req, State) ->
|
|||
handler_init(Req, State).
|
||||
|
||||
-spec handler_init(Req::#http_req{}, State::#state{}) -> ok.
|
||||
handler_init(Req, State=#state{handler={Handler, Opts}}) ->
|
||||
case catch Handler:init(Req, Opts) of
|
||||
handler_init(Req, State=#state{
|
||||
transport=Transport, handler={Handler, Opts}}) ->
|
||||
case catch Handler:init({Transport:name(), http}, Req, Opts) of
|
||||
{ok, Req, HandlerState} ->
|
||||
handler_loop(HandlerState, Req, State);
|
||||
%% @todo {upgrade, transport, Module}; {upgrade, protocol, Module}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue