0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

Allow Handler:init/3 to request a protocol upgrade.

This commit is contained in:
Loïc Hoguin 2011-03-22 23:03:43 +01:00
parent 7888be00d2
commit 9fe8141d2a

View file

@ -135,7 +135,9 @@ handler_init(Req, State=#state{
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}
%% @todo {upgrade, transport, Module}
{upgrade, protocol, Module} ->
Module:upgrade(Handler, Opts, Req);
{'EXIT', _Reason} ->
error_terminate(500, State)
end.