diff options
author | Loïc Hoguin <[email protected]> | 2019-07-22 16:17:10 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-07-22 16:17:10 +0200 |
commit | 516933f9dd2722329b3886c495d5242308958fe1 (patch) | |
tree | 60b16423184a4db405a65266c326b7944ce42256 /src/gun_default_event_h.erl | |
parent | 265ece680c53f77d1685434d0636216c94021497 (diff) | |
download | gun-516933f9dd2722329b3886c495d5242308958fe1.tar.gz gun-516933f9dd2722329b3886c495d5242308958fe1.tar.bz2 gun-516933f9dd2722329b3886c495d5242308958fe1.zip |
Split domain lookup/connect/TLS handshake and add events
This changes the way we connect to servers entirely. We now have
three states when connecting (domain_lookup, connect and
tls_handshake when applicable) and as a result three corresponding
timeout options. Each state has a start/end event associated and
the event data was tweaked to best match each event. Since the
TLS handshake is separate, the transport_opts option was also
split into two: tcp_opts and tls_opts.
Diffstat (limited to 'src/gun_default_event_h.erl')
-rw-r--r-- | src/gun_default_event_h.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gun_default_event_h.erl b/src/gun_default_event_h.erl index de63f17..9b56e71 100644 --- a/src/gun_default_event_h.erl +++ b/src/gun_default_event_h.erl @@ -16,8 +16,12 @@ -behavior(gun_event). -export([init/2]). +-export([domain_lookup_start/2]). +-export([domain_lookup_end/2]). -export([connect_start/2]). -export([connect_end/2]). +-export([tls_handshake_start/2]). +-export([tls_handshake_end/2]). -export([request_start/2]). -export([request_headers/2]). -export([request_end/2]). @@ -39,12 +43,24 @@ init(_EventData, State) -> State. +domain_lookup_start(_EventData, State) -> + State. + +domain_lookup_end(_EventData, State) -> + State. + connect_start(_EventData, State) -> State. connect_end(_EventData, State) -> State. +tls_handshake_start(_EventData, State) -> + State. + +tls_handshake_end(_EventData, State) -> + State. + request_start(_EventData, State) -> State. |