mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 13:10:24 +00:00
Allow passing the Req and an updated Opts when upgrading protocols
This commit is contained in:
parent
067958abd2
commit
5ef4a15b48
3 changed files with 66 additions and 3 deletions
|
@ -491,7 +491,9 @@ handler_init(Req, State=#state{transport=Transport}, Handler, Opts) ->
|
|||
handler_terminate(Req2, Handler, HandlerState);
|
||||
%% @todo {upgrade, transport, Module}
|
||||
{upgrade, protocol, Module} ->
|
||||
upgrade_protocol(Req, State, Handler, Opts, Module)
|
||||
upgrade_protocol(Req, State, Handler, Opts, Module);
|
||||
{upgrade, protocol, Module, Req2, Opts2} ->
|
||||
upgrade_protocol(Req2, State, Handler, Opts2, Module)
|
||||
catch Class:Reason ->
|
||||
error_terminate(500, State),
|
||||
error_logger:error_msg(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue