From 28c19230eda29c42b376e35046d39acc1365881a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 16 Sep 2019 21:26:51 +0200 Subject: Further consolidation of TLS handshakes --- src/gun_tls_proxy.erl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/gun_tls_proxy.erl') diff --git a/src/gun_tls_proxy.erl b/src/gun_tls_proxy.erl index d519919..1bd56cb 100644 --- a/src/gun_tls_proxy.erl +++ b/src/gun_tls_proxy.erl @@ -237,12 +237,7 @@ not_connected(cast, Msg={setopts, _}, State) -> {keep_state_and_data, postpone}; not_connected(cast, Msg={connect_proc, {ok, Socket}}, State=#state{owner_pid=OwnerPid, extra=Extra}) -> ?DEBUG_LOG("msg ~0p state ~0p", [Msg, State]), - %% @todo We should distinguish case when no protocol was negotiated (for socks). - Protocol = case ssl:negotiated_protocol(Socket) of - {ok, <<"h2">>} -> gun_http2; - _ -> gun_http - end, - OwnerPid ! {?MODULE, self(), {ok, Protocol}, Extra}, + OwnerPid ! {?MODULE, self(), {ok, ssl:negotiated_protocol(Socket)}, Extra}, %% We need to spawn this call before OTP-21.2 because it triggers %% a cb_setopts call that blocks us. Might be OK to just leave it %% like this once we support 21.2+ only. -- cgit v1.2.3