aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_http2.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-09-21 13:23:02 +0200
committerLoïc Hoguin <[email protected]>2020-09-21 15:52:26 +0200
commit920afa71ac298032b376753594133c98bd36d04a (patch)
tree76e412079baf37f4c15ec6ebabcd06793b15d7c3 /src/gun_http2.erl
parent43df59e49b1ab92e3ca0a333ae403742b2ed7a5d (diff)
downloadgun-920afa71ac298032b376753594133c98bd36d04a.tar.gz
gun-920afa71ac298032b376753594133c98bd36d04a.tar.bz2
gun-920afa71ac298032b376753594133c98bd36d04a.zip
Fix compilation and Dialyzer warnings
Diffstat (limited to 'src/gun_http2.erl')
-rw-r--r--src/gun_http2.erl11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl
index 65b92e2..98a7e6c 100644
--- a/src/gun_http2.erl
+++ b/src/gun_http2.erl
@@ -418,7 +418,6 @@ headers_frame(State0=#http2_state{transport=Transport, opts=Opts,
#tunnel{destination=Destination, info=TunnelInfo0} = Tunnel,
#{host := DestHost, port := DestPort} = Destination,
TunnelInfo = TunnelInfo0#{
- transport => maps:get(transport, Destination, tcp),
origin_host => DestHost,
origin_port => DestPort
},
@@ -1040,8 +1039,10 @@ timeout(State=#http2_state{http2_machine=HTTP2Machine0}, {cow_http2_machine, Nam
stream_info(State, StreamRef) when is_reference(StreamRef) ->
case get_stream_by_ref(State, StreamRef) of
- #stream{reply_to=ReplyTo, tunnel=#tunnel{protocol=Proto, protocol_state=ProtoState,
- info=#{transport := Transport, origin_host := OriginHost, origin_port := OriginPort}}} ->
+ #stream{reply_to=ReplyTo, tunnel=#tunnel{destination=Destination,
+ info=#{origin_host := OriginHost, origin_port := OriginPort},
+ protocol=Proto, protocol_state=ProtoState}} ->
+ Transport = maps:get(transport, Destination, tcp),
{ok, #{
ref => StreamRef,
reply_to => ReplyTo,
@@ -1072,10 +1073,6 @@ stream_info(State, StreamRefList=[StreamRef|Tail]) ->
#stream{tunnel=#tunnel{protocol=Proto, protocol_state=ProtoState}} ->
%% We must return the real StreamRef as seen by the user.
%% We therefore set it on return, with the outer layer "winning".
- %%
- %% We also add intermediaries which are prepended to the list and
- %% therefore are ultimately given from outer to inner layer just
- %% like gun:info/1 intermediaries.
case Proto:stream_info(ProtoState, normalize_stream_ref(Tail)) of
{ok, undefined} ->
{ok, undefined};