diff options
author | Loïc Hoguin <[email protected]> | 2020-07-17 12:25:11 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-09-21 15:51:56 +0200 |
commit | 510d49d8ef0a46e90374c3230f28b5354115293f (patch) | |
tree | 2260d16089803e9e6e9c3e9156e21f83b0eae81c /src/gun_http.erl | |
parent | a093bf88e1740e4f89937d84cd4d5b26cb5b4e80 (diff) | |
download | gun-510d49d8ef0a46e90374c3230f28b5354115293f.tar.gz gun-510d49d8ef0a46e90374c3230f28b5354115293f.tar.bz2 gun-510d49d8ef0a46e90374c3230f28b5354115293f.zip |
Make gun:stream_info/2 return intermediaries for HTTP/2 CONNECT
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r-- | src/gun_http.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index b5ad751..aae47cf 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -29,7 +29,7 @@ -export([headers/11]). -export([request/12]). -export([data/7]). --export([connect/6]). +-export([connect/7]). -export([cancel/5]). -export([stream_info/2]). -export([down/1]). @@ -683,12 +683,12 @@ data(State=#http_state{socket=Socket, transport=Transport, version=Version, {error_stream_not_found(State, StreamRef, ReplyTo), EvHandlerState0} end. -connect(State=#http_state{streams=Streams}, StreamRef, ReplyTo, _, _, _) when Streams =/= [] -> +connect(State=#http_state{streams=Streams}, StreamRef, ReplyTo, _, _, _, _) when Streams =/= [] -> ReplyTo ! {gun_error, self(), StreamRef, {badstate, "CONNECT can only be used with HTTP/1.1 when no other streams are active."}}, State; connect(State=#http_state{socket=Socket, transport=Transport, opts=Opts, version=Version}, - StreamRef, ReplyTo, Destination=#{host := Host0}, Headers0, InitialFlow0) -> + StreamRef, ReplyTo, Destination=#{host := Host0}, _TunnelInfo, Headers0, InitialFlow0) -> Host = case Host0 of Tuple when is_tuple(Tuple) -> inet:ntoa(Tuple); _ -> Host0 |