diff options
author | Ingela Anderton Andin <[email protected]> | 2017-12-20 11:51:05 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-12-20 11:51:05 +0100 |
commit | 04233733012408b75754ff4de2742e97d41b25af (patch) | |
tree | 73abaf83e86d4d2b4d440e545063f97c13e50709 /lib/ssl/src | |
parent | 85f3051f40e731c530433eba2363c5c2a80b588e (diff) | |
parent | 14c43c187018812d52c4f08bef3f8768d68dc7bc (diff) | |
download | otp-04233733012408b75754ff4de2742e97d41b25af.tar.gz otp-04233733012408b75754ff4de2742e97d41b25af.tar.bz2 otp-04233733012408b75754ff4de2742e97d41b25af.zip |
Merge branch 'ingela/dtls-cuddling' into maint
* ingela/dtls-cuddling:
dtls: Correct UDP listener cleanup
dtls: Correct return value in UDP listener initialization
Diffstat (limited to 'lib/ssl/src')
-rw-r--r-- | lib/ssl/src/dtls_udp_listener.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ssl/src/dtls_udp_listener.erl b/lib/ssl/src/dtls_udp_listener.erl index c789a32087..12e54a0e51 100644 --- a/lib/ssl/src/dtls_udp_listener.erl +++ b/lib/ssl/src/dtls_udp_listener.erl @@ -84,7 +84,7 @@ init([Port, EmOpts, InetOptions, DTLSOptions]) -> listner = Socket, close = false}} catch _:_ -> - {error, closed} + {stop, {shutdown, {error, closed}}} end. handle_call({accept, _}, _, #state{close = true} = State) -> {reply, {error, closed}, State}; @@ -153,15 +153,18 @@ handle_info({udp_error, Socket, Error}, #state{listner = Socket} = State) -> handle_info({'DOWN', _, process, Pid, _}, #state{clients = Clients, dtls_processes = Processes0, + dtls_msq_queues = MsgQueues0, close = ListenClosed} = State) -> Client = kv_get(Pid, Processes0), Processes = kv_delete(Pid, Processes0), + MsgQueues = kv_delete(Client, MsgQueues0), case ListenClosed andalso kv_empty(Processes) of true -> {stop, normal, State}; false -> {noreply, State#state{clients = set_delete(Client, Clients), - dtls_processes = Processes}} + dtls_processes = Processes, + dtls_msq_queues = MsgQueues}} end. terminate(_Reason, _State) -> |