diff options
author | Loïc Hoguin <[email protected]> | 2020-08-24 17:06:23 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-09-21 15:51:57 +0200 |
commit | d056e5fb2a1fbb54e108c5c61384573acf21b4cf (patch) | |
tree | ccf9131d63fbace32e2d99941fb6b1d788f6ec7f /src/gun_http2.erl | |
parent | 2c8db0879109dd90443d7b276e5ca2daf83920bc (diff) | |
download | gun-d056e5fb2a1fbb54e108c5c61384573acf21b4cf.tar.gz gun-d056e5fb2a1fbb54e108c5c61384573acf21b4cf.tar.bz2 gun-d056e5fb2a1fbb54e108c5c61384573acf21b4cf.zip |
Replace gun_tunnel_up/3 message with /4 variant
Also fixes all the tests. Lots of work remain around protocols
(how best to pass the base stream_ref to them? maybe the current
solution, maybe a new argument to Protocol:init) and strengthen
the concept of stream_ref, at least with its own type.
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 5b8d229..ad52555 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -371,13 +371,14 @@ tunnel_commands([{switch_protocol, Protocol0, ReplyTo}|Tail], Stream=#stream{ref gun_socks -> ReplyTo ! {gun_tunnel_up, self(), stream_ref(State, StreamRef), Protocol:name()}; _ -> ok end, + RealStreamRef = stream_ref(State, StreamRef), OriginSocket = #{ gun_pid => self(), reply_to => ReplyTo, - stream_ref => StreamRef + stream_ref => RealStreamRef }, OriginTransport = gun_tcp_proxy, - {_, ProtoState} = Protocol:init(ReplyTo, OriginSocket, OriginTransport, ProtoOpts), + {_, ProtoState} = Protocol:init(ReplyTo, OriginSocket, OriginTransport, ProtoOpts#{stream_ref => RealStreamRef}), %% @todo EvHandlerState = EvHandler:protocol_changed(#{protocol => Protocol:name()}, EvHandlerState0), tunnel_commands([{state, ProtoState}|Tail], Stream, Protocol, TunnelInfo, State); tunnel_commands([{active, true}|Tail], Stream, Protocol, TunnelInfo, State) -> |