aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-05-22 14:30:43 +0200
committerIngela Anderton Andin <[email protected]>2017-05-22 14:30:43 +0200
commite577de4216f2dc180aac3e30949804db0b3e817d (patch)
tree949455da1652a470f2f85f092633473f2991cd36 /lib
parent8404980fda28ca9a8d4e8899736a77c9d09a568d (diff)
parentb8cb38d3ac35b60f518fe86b7f86dd9053893831 (diff)
downloadotp-e577de4216f2dc180aac3e30949804db0b3e817d.tar.gz
otp-e577de4216f2dc180aac3e30949804db0b3e817d.tar.bz2
otp-e577de4216f2dc180aac3e30949804db0b3e817d.zip
Merge branch 'ingela/dtls/windows-econnreset'
* ingela/dtls/windows-econnreset: ssl: Handle econnreset windows obscurities
Diffstat (limited to 'lib')
-rw-r--r--lib/ssl/src/dtls_udp_listener.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ssl/src/dtls_udp_listener.erl b/lib/ssl/src/dtls_udp_listener.erl
index f0ace2d887..29380e3008 100644
--- a/lib/ssl/src/dtls_udp_listener.erl
+++ b/lib/ssl/src/dtls_udp_listener.erl
@@ -121,6 +121,18 @@ handle_info({udp, Socket, IP, InPortNo, _} = Msg, #state{listner = Socket} = Sta
next_datagram(Socket),
{noreply, State};
+%% UDP socket does not have a connection and should not receive an econnreset
+%% This does however happens on on some windows versions. Just ignoring it
+%% appears to make things work as expected!
+handle_info({udp_error, Socket, econnreset = Error}, #state{listner = Socket} = State) ->
+ Report = io_lib:format("Ignore SSL UDP Listener: Socket error: ~p ~n", [Error]),
+ error_logger:info_report(Report),
+ {noreply, State};
+handle_info({udp_error, Socket, Error}, #state{listner = Socket} = State) ->
+ Report = io_lib:format("SSL UDP Listener shutdown: Socket error: ~p ~n", [Error]),
+ error_logger:info_report(Report),
+ {noreply, State#state{close=true}};
+
handle_info({'DOWN', _, process, Pid, _}, #state{clients = Clients,
dtls_processes = Processes0,
close = ListenClosed} = State) ->