diff options
author | Ingela Anderton Andin <[email protected]> | 2017-05-06 16:25:11 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-05-22 14:28:25 +0200 |
commit | b8cb38d3ac35b60f518fe86b7f86dd9053893831 (patch) | |
tree | 949455da1652a470f2f85f092633473f2991cd36 /lib/ssl/src | |
parent | 8404980fda28ca9a8d4e8899736a77c9d09a568d (diff) | |
download | otp-b8cb38d3ac35b60f518fe86b7f86dd9053893831.tar.gz otp-b8cb38d3ac35b60f518fe86b7f86dd9053893831.tar.bz2 otp-b8cb38d3ac35b60f518fe86b7f86dd9053893831.zip |
ssl: Handle econnreset windows obscurities
An UDP socket does note have a connection and should
not recive econnreset, however this happens on on some windows versions.
Just ignoring it appears to make things work as expected!
Diffstat (limited to 'lib/ssl/src')
-rw-r--r-- | lib/ssl/src/dtls_udp_listener.erl | 12 |
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) -> |