From 516933f9dd2722329b3886c495d5242308958fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 22 Jul 2019 16:17:10 +0200 Subject: 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. --- src/gun_tls.erl | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/gun_tls.erl') diff --git a/src/gun_tls.erl b/src/gun_tls.erl index 256b881..3f8d1d6 100644 --- a/src/gun_tls.erl +++ b/src/gun_tls.erl @@ -17,7 +17,6 @@ -export([name/0]). -export([messages/0]). -export([connect/3]). --export([connect/4]). -export([send/2]). -export([setopts/2]). -export([sockname/1]). @@ -32,14 +31,6 @@ messages() -> {ssl, ssl_closed, ssl_error}. connect(Socket, Opts, Timeout) -> ssl:connect(Socket, Opts, Timeout). --spec connect(inet:ip_address() | inet:hostname(), - inet:port_number(), any(), timeout()) - -> {ok, ssl:sslsocket()} | {error, atom()}. -connect(Host, Port, Opts, Timeout) when is_integer(Port) -> - ssl:connect(Host, Port, - Opts ++ [binary, {active, false}, {packet, raw}], - Timeout). - -spec send(ssl:sslsocket(), iodata()) -> ok | {error, atom()}. send(Socket, Packet) -> ssl:send(Socket, Packet). -- cgit v1.2.3