aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/dtls_packet_demux.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-02-16 10:25:48 +0100
committerLoïc Hoguin <[email protected]>2019-02-19 10:00:12 +0100
commit33a9c7d4c916996708694428f8b285f51c1256ff (patch)
tree06ed8f57bb13a4e3a09a25731b6096aa2d58e7a2 /lib/ssl/src/dtls_packet_demux.erl
parent4f0b8e5eb61a2019285bfc7a8e50af1d338ffd63 (diff)
downloadotp-33a9c7d4c916996708694428f8b285f51c1256ff.tar.gz
otp-33a9c7d4c916996708694428f8b285f51c1256ff.tar.bz2
otp-33a9c7d4c916996708694428f8b285f51c1256ff.zip
ssl: Use common fonction to update {active,N}
Diffstat (limited to 'lib/ssl/src/dtls_packet_demux.erl')
-rw-r--r--lib/ssl/src/dtls_packet_demux.erl11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/ssl/src/dtls_packet_demux.erl b/lib/ssl/src/dtls_packet_demux.erl
index 4945ef3c10..092366b7c0 100644
--- a/lib/ssl/src/dtls_packet_demux.erl
+++ b/lib/ssl/src/dtls_packet_demux.erl
@@ -298,16 +298,7 @@ do_set_emulated_opts([], Opts) ->
do_set_emulated_opts([{mode, Value} | Rest], Opts) ->
do_set_emulated_opts(Rest, Opts#socket_options{mode = Value});
do_set_emulated_opts([{active, N0} | Rest], Opts=#socket_options{active = Active}) when is_integer(N0) ->
- N = case Active of
- N1 when is_integer(N1), N0 + N1 =< 0 ->
- false;
- N1 when is_integer(N1) ->
- N0 + N1;
- _ when N0 =< 0 ->
- false;
- _ ->
- N0
- end,
+ N = tls_socket:update_active_n(N0, Active),
do_set_emulated_opts(Rest, Opts#socket_options{active = N});
do_set_emulated_opts([{active, Value} | Rest], Opts) ->
do_set_emulated_opts(Rest, Opts#socket_options{active = Value}).