aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
authorDenys Knertser <[email protected]>2021-07-19 17:00:38 +0200
committerLoïc Hoguin <[email protected]>2022-11-14 11:40:08 +0100
commit8d51ab4e04168223b660f353b033eb3cffcee696 (patch)
tree8eaab9e4b34a617e98a3465b3d7a26aabf67a2e5 /src/gun.erl
parent9591d4c2df694115c5c5ff1b159117fa3032d428 (diff)
downloadgun-8d51ab4e04168223b660f353b033eb3cffcee696.tar.gz
gun-8d51ab4e04168223b660f353b033eb3cffcee696.tar.bz2
gun-8d51ab4e04168223b660f353b033eb3cffcee696.zip
Implement gun_raw:down/1, gun_raw:update_flow/4
Loïc: I have reworded a couple things and reordered the tests. It would be great to also test these things over proxies.
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gun.erl b/src/gun.erl
index f5fad75..bd19b7c 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -141,6 +141,7 @@
http_opts => http_opts(),
http2_opts => http2_opts(),
protocols => protocols(),
+ raw_opts => raw_opts(),
retry => non_neg_integer(),
retry_fun => fun((non_neg_integer(), opts())
-> #{retries => non_neg_integer(), timeout => pos_integer()}),
@@ -188,6 +189,7 @@
-export_type([tunnel_info/0]).
-type raw_opts() :: #{
+ flow => pos_integer(),
%% Internal.
tunnel_transport => tcp | tls
}.
@@ -369,6 +371,13 @@ check_options([Opt = {protocols, L}|Opts]) when is_list(L) ->
ok -> check_options(Opts);
error -> {error, {options, Opt}}
end;
+check_options([{raw_opts, ProtoOpts}|Opts]) when is_map(ProtoOpts) ->
+ case gun_raw:check_options(ProtoOpts) of
+ ok ->
+ check_options(Opts);
+ Error ->
+ Error
+ end;
check_options([{retry, R}|Opts]) when is_integer(R), R >= 0 ->
check_options(Opts);
check_options([{retry_fun, F}|Opts]) when is_function(F, 2) ->