diff options
author | Viktor Söderqvist <[email protected]> | 2022-08-25 14:29:35 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2022-08-30 14:21:00 +0200 |
commit | ad6302f51092009de5b1d4481ef2bfcd4091a257 (patch) | |
tree | 7938a0e63a3688a455a252ca5ca3113f2c6622f9 /src/gun_http2.erl | |
parent | 5a175dc6d5c0beddb78900b2d4ad817c9be7c2df (diff) | |
download | gun-ad6302f51092009de5b1d4481ef2bfcd4091a257.tar.gz gun-ad6302f51092009de5b1d4481ef2bfcd4091a257.tar.bz2 gun-ad6302f51092009de5b1d4481ef2bfcd4091a257.zip |
Make Protocol:init/4 return an ok-tuple
This is a preparation for allowing init/4 to return an ok or an
error tuple.
Diffstat (limited to 'src/gun_http2.erl')
-rw-r--r-- | src/gun_http2.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl index e681963..e3ff130 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -186,7 +186,7 @@ init(ReplyTo, Socket, Transport, Opts0) -> opts=Opts, base_stream_ref=BaseStreamRef, tunnel_transport=TunnelTransport, content_handlers=Handlers, http2_machine=HTTP2Machine}, Transport:send(Socket, Preface), - {connected, State}. + {ok, connected, State}. switch_transport(Transport, Socket, State) -> State#http2_state{socket=Socket, transport=Transport}. @@ -609,7 +609,8 @@ headers_frame_connect_websocket(State, Stream=#stream{ref=StreamRef, reply_to=Re handler => Handler, opts => WsOpts }, - {connected_ws_only, ProtoState} = Proto:init( + %% @todo Handle error result from Proto:init/4 + {ok, connected_ws_only, ProtoState} = Proto:init( ReplyTo, OriginSocket, gun_tcp_proxy, ProtoOpts), {store_stream(State, Stream#stream{tunnel=Tunnel#tunnel{state=established, protocol=Proto, protocol_state=ProtoState}}), |