0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00

Remove cowboy_req:transport/1

It was added to help with response body streaming functions.
But it was a clumsy solution that we discarded in favor of
passing socket and transport to said function. It was also
very odd compared to the rest of the cowboy_req interface.

If you used this function before, worry not, here's its
proper equivalent.

[Socket, Transport] = cowboy_req:get([socket, transport], Req)
This commit is contained in:
Loïc Hoguin 2013-01-05 22:04:52 +01:00
parent 58e89e2189
commit c930327fbf
2 changed files with 1 additions and 14 deletions

View file

@ -66,7 +66,7 @@
upgrade(Req, Env, Handler, HandlerOpts) ->
{_, ListenerPid} = lists:keyfind(listener, 1, Env),
ranch_listener:remove_connection(ListenerPid),
{ok, Transport, Socket} = cowboy_req:transport(Req),
[Socket, Transport] = cowboy_req:get([socket, transport], Req),
State = #state{env=Env, socket=Socket, transport=Transport,
handler=Handler, handler_opts=HandlerOpts},
case catch websocket_upgrade(State, Req) of