diff options
author | Loïc Hoguin <[email protected]> | 2019-09-16 20:02:36 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-09-22 16:46:35 +0200 |
commit | 5043b98d5301e41238afd15d271f5c6b68081b04 (patch) | |
tree | cc0ce0920861839cc536bb59f97cfb0d68877dcc /src/gun_http.erl | |
parent | 93552edd8afb598a3ef6d358fb6918fb9ff60856 (diff) | |
download | gun-5043b98d5301e41238afd15d271f5c6b68081b04.tar.gz gun-5043b98d5301e41238afd15d271f5c6b68081b04.tar.bz2 gun-5043b98d5301e41238afd15d271f5c6b68081b04.zip |
Simplify HandshakeEvent
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r-- | src/gun_http.erl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index 59b127f..576c013 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -298,12 +298,14 @@ handle_head(Data, State=#http_state{version=ClientVersion, content_handlers=Hand Protocols = maps:get(protocols, Destination, [http]), case Destination of #{transport := tls} -> - TLSOpts = maps:get(tls_opts, Destination, []), - TLSTimeout = maps:get(tls_handshake_timeout, Destination, infinity), - {[ - {origin, <<"https">>, NewHost, NewPort, connect}, - {tls_handshake, RealStreamRef, ReplyTo, TLSOpts, TLSTimeout, Protocols} - ], EvHandlerState1}; + HandshakeEvent = #{ + stream_ref => RealStreamRef, + reply_to => ReplyTo, + tls_opts => maps:get(tls_opts, Destination, []), + timeout => maps:get(tls_handshake_timeout, Destination, infinity) + }, + {[{origin, <<"https">>, NewHost, NewPort, connect}, + {tls_handshake, HandshakeEvent, Protocols}], EvHandlerState1}; _ -> case Protocols of [http] -> |