From d7481d5f593f48327d16c29b48a74e49c7581e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 17 Jul 2020 14:05:43 +0200 Subject: Improve HTTP/2 CONNECT to non-HTTP origin Now has a proper StreamRef given to it by the CONNECT stream. --- src/gun_http2.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gun_http2.erl') diff --git a/src/gun_http2.erl b/src/gun_http2.erl index 0dad3d9..e1a9873 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -407,7 +407,9 @@ headers_frame(State0=#http2_state{content_handlers=Handlers0, commands_queue=Com stream_ref => StreamRef }, OriginTransport = gun_tcp_proxy, - {_, ProtoState} = Protocol:init(ReplyTo, OriginSocket, OriginTransport, ProtoOpts), + {_, ProtoState} = Protocol:init(ReplyTo, OriginSocket, OriginTransport, + %% @todo We are giving the wrong StreamRef we need to give the list (if any). + ProtoOpts#{stream_ref => StreamRef}), %% @todo EvHandlerState = EvHandler:protocol_changed(#{protocol => Protocol:name()}, EvHandlerState0), %% @todo What about keepalive? {store_stream(State, Stream#stream{tunnel={Protocol, ProtoState, -- cgit v1.2.3