aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-07-27 16:53:26 +0200
committerLoïc Hoguin <[email protected]>2019-07-27 16:54:15 +0200
commit145b9af4bdbb85e2f83959ee8abaa4d9207a4529 (patch)
tree5be8e222957b00eafac16f006e26bb90ac46bf81 /src/gun.erl
parent50ff97bf82cd146cb289e5b9fbd864bbcc9c30d9 (diff)
downloadgun-145b9af4bdbb85e2f83959ee8abaa4d9207a4529.tar.gz
gun-145b9af4bdbb85e2f83959ee8abaa4d9207a4529.tar.bz2
gun-145b9af4bdbb85e2f83959ee8abaa4d9207a4529.zip
Fix ssl and other types
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gun.erl b/src/gun.erl
index 74866ec..d758ffc 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -104,9 +104,11 @@
-export_type([req_headers/0]).
-type ws_close_code() :: 1000..4999.
+
-type ws_frame() :: close | ping | pong
| {text | binary | close | ping | pong, iodata()}
| {close, ws_close_code(), iodata()}.
+-export_type([ws_frame/0]).
-type opts() :: #{
connect_timeout => timeout(),
@@ -122,7 +124,7 @@
supervise => boolean(),
tcp_opts => [gen_tcp:connect_option()],
tls_handshake_timeout => timeout(),
- tls_opts => [ssl:connect_option()],
+ tls_opts => [ssl:tls_client_option()],
trace => boolean(),
transport => tcp | tls | ssl,
ws_opts => ws_opts()
@@ -138,7 +140,7 @@
protocol => http | http2, %% @todo Remove in Gun 2.0.
protocols => [http | http2],
transport => tcp | tls,
- tls_opts => [ssl:connect_option()],
+ tls_opts => [ssl:tls_client_option()],
tls_handshake_timeout => timeout()
}.
-export_type([connect_destination/0]).
@@ -771,7 +773,6 @@ init({Owner, Host, Port, Opts}) ->
default_transport(443) -> tls;
default_transport(_) -> tcp.
-%% @todo This is where we would implement the backoff mechanism presumably.
not_connected(_, {retries, 0, Reason}, State) ->
{stop, {shutdown, Reason}, State};
not_connected(_, {retries, Retries0, _}, State=#state{opts=Opts}) ->