diff options
author | Loïc Hoguin <[email protected]> | 2020-07-30 15:59:23 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-09-21 15:51:57 +0200 |
commit | a1729d5584364412f72d0d6337447da653da865b (patch) | |
tree | f67daf56820310fe3d98ddceed3de60aedbb5984 /src | |
parent | f1e7517c05bb97c257ad7a39e170ebc91ca42149 (diff) | |
download | gun-a1729d5584364412f72d0d6337447da653da865b.tar.gz gun-a1729d5584364412f72d0d6337447da653da865b.tar.bz2 gun-a1729d5584364412f72d0d6337447da653da865b.zip |
Make gun_socks_up stream-specific for HTTP/2 CONNECT
Diffstat (limited to 'src')
-rw-r--r-- | src/gun.erl | 2 | ||||
-rw-r--r-- | src/gun_http2.erl | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gun.erl b/src/gun.erl index 987b806..9d16f58 100644 --- a/src/gun.erl +++ b/src/gun.erl @@ -719,6 +719,8 @@ await(ServerPid, StreamRef, Timeout, MRef) -> {upgrade, Protocols, Headers}; {gun_ws, ServerPid, StreamRef, Frame} -> {ws, Frame}; + {gun_socks_up, ServerPid, StreamRef, Protocol} -> + {up, Protocol}; {gun_error, ServerPid, StreamRef, Reason} -> {error, {stream_error, Reason}}; {gun_error, ServerPid, Reason} -> diff --git a/src/gun_http2.erl b/src/gun_http2.erl index b8ae033..11dbb3d 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -368,9 +368,8 @@ tunnel_commands([{switch_protocol, Protocol0, ReplyTo}|Tail], Stream=#stream{ref {Protocol1, maps:get(Protocol1:opts_name(), Opts, #{})} end, %% When we switch_protocol from socks we must send a gun_socks_up message. -%% @todo OK but perhaps we should give the StreamRef!! _ = case CurrentProtocol of - gun_socks -> ReplyTo ! {gun_socks_up, self(), Protocol:name()}; + gun_socks -> ReplyTo ! {gun_socks_up, self(), stream_ref(State, StreamRef), Protocol:name()}; _ -> ok end, OriginSocket = #{ |