diff options
author | Ingela Anderton Andin <[email protected]> | 2017-12-06 11:26:03 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-12-20 12:20:23 +0100 |
commit | 09fce86de093ff00d59f86ec01439dc210789425 (patch) | |
tree | 071649027d7c38fb3c517eed22aa4f1e0db648f4 | |
parent | 04233733012408b75754ff4de2742e97d41b25af (diff) | |
download | otp-09fce86de093ff00d59f86ec01439dc210789425.tar.gz otp-09fce86de093ff00d59f86ec01439dc210789425.tar.bz2 otp-09fce86de093ff00d59f86ec01439dc210789425.zip |
ssl: Correct DTLS client close handling
-rw-r--r-- | lib/ssl/src/dtls_connection.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl index 55091c0219..6f22b60136 100644 --- a/lib/ssl/src/dtls_connection.erl +++ b/lib/ssl/src/dtls_connection.erl @@ -143,10 +143,16 @@ next_record(#state{role = server, dtls_udp_listener:active_once(Listener, Client, self()), {no_record, State}; next_record(#state{role = client, - socket = {_Server, Socket}, + socket = {_Server, Socket} = DTLSSocket, + close_tag = CloseTag, transport_cb = Transport} = State) -> - dtls_socket:setopts(Transport, Socket, [{active,once}]), - {no_record, State}; + case dtls_socket:setopts(Transport, Socket, [{active,once}]) of + ok -> + {no_record, State}; + _ -> + self() ! {CloseTag, DTLSSocket}, + {no_record, State} + end; next_record(State) -> {no_record, State}. |