From 8d51ab4e04168223b660f353b033eb3cffcee696 Mon Sep 17 00:00:00 2001 From: Denys Knertser Date: Mon, 19 Jul 2021 17:00:38 +0200 Subject: Implement gun_raw:down/1, gun_raw:update_flow/4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Loïc: I have reworded a couple things and reordered the tests. It would be great to also test these things over proxies. --- src/gun.erl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gun.erl') 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) -> -- cgit v1.2.3