aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_s2s_out.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-05-08 12:59:28 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-05-08 12:59:28 +0300
commit01a2c9fe1202f88f20a5acbc729b627ce0ac3c0a (patch)
tree4aba0e94650d1311ab5b2da0e74563b1bd02a876 /src/ejabberd_s2s_out.erl
parentLOG_PATH macro should be of string type (diff)
Add type specs for Module:opt_type/1
Diffstat (limited to 'src/ejabberd_s2s_out.erl')
-rw-r--r--src/ejabberd_s2s_out.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl
index deff3e5b5..bcacd8e77 100644
--- a/src/ejabberd_s2s_out.erl
+++ b/src/ejabberd_s2s_out.erl
@@ -439,6 +439,13 @@ maybe_report_huge_timeout(Opt, T) when is_integer(T), T >= 1000 ->
maybe_report_huge_timeout(_, _) ->
ok.
+-spec opt_type(outgoing_s2s_families) -> fun(([ipv4|ipv6]) -> [inet|inet6]);
+ (outgoing_s2s_port) -> fun((0..65535) -> 0..65535);
+ (outgoing_s2s_timeout) -> fun((timeout()) -> timeout());
+ (s2s_dns_retries) -> fun((non_neg_integer()) -> non_neg_integer());
+ (s2s_dns_timeout) -> fun((timeout()) -> timeout());
+ (s2s_max_retry_delay) -> fun((pos_integer()) -> pos_integer());
+ (atom()) -> [atom()].
opt_type(outgoing_s2s_families) ->
fun(Families) ->
lists:map(
@@ -447,7 +454,7 @@ opt_type(outgoing_s2s_families) ->
end, Families)
end;
opt_type(outgoing_s2s_port) ->
- fun (I) when is_integer(I), I > 0, I =< 65536 -> I end;
+ fun (I) when is_integer(I), I > 0, I < 65536 -> I end;
opt_type(outgoing_s2s_timeout) ->
fun(TimeOut) when is_integer(TimeOut), TimeOut > 0 ->
timer:seconds(TimeOut);