aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_tls.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-07-22 16:17:10 +0200
committerLoïc Hoguin <[email protected]>2019-07-22 16:17:10 +0200
commit516933f9dd2722329b3886c495d5242308958fe1 (patch)
tree60b16423184a4db405a65266c326b7944ce42256 /src/gun_tls.erl
parent265ece680c53f77d1685434d0636216c94021497 (diff)
downloadgun-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_tls.erl')
-rw-r--r--src/gun_tls.erl9
1 files changed, 0 insertions, 9 deletions
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).