aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/dtls_packet_demux.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssl/src/dtls_packet_demux.erl')
-rw-r--r--lib/ssl/src/dtls_packet_demux.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ssl/src/dtls_packet_demux.erl b/lib/ssl/src/dtls_packet_demux.erl
index dccc22a448..4945ef3c10 100644
--- a/lib/ssl/src/dtls_packet_demux.erl
+++ b/lib/ssl/src/dtls_packet_demux.erl
@@ -297,6 +297,18 @@ do_set_emulated_opts([], 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,
+ 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}).