aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-03-22 19:50:02 +0100
committerLoïc Hoguin <[email protected]>2011-03-22 19:50:02 +0100
commit7888be00d254677362ea2904c2c8cceeb1fc0663 (patch)
tree3fa3b12ae340644cb49cf6468f2a59442ac5dbb6 /src
parente0185dd27fef66a1fc9a92db9c1a75cc8a130821 (diff)
downloadcowboy-7888be00d254677362ea2904c2c8cceeb1fc0663.tar.gz
cowboy-7888be00d254677362ea2904c2c8cceeb1fc0663.tar.bz2
cowboy-7888be00d254677362ea2904c2c8cceeb1fc0663.zip
Forward transport and protocol name to Handler:init.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_http_protocol.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index 9bb22c3..d950373 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -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}