diff options
author | Raimo Niskanen <[email protected]> | 2018-11-30 14:52:19 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2018-11-30 15:07:18 +0100 |
commit | b96f872bba8cbcd87d1e1f4a5caffdb362f45111 (patch) | |
tree | affceeb1f6d60ceb9c03a5498ec34e5ac5f4fc83 /lib/ssl/src/tls_connection.erl | |
parent | cadbaea28debb5fb761597afb7f3ff85367f2a0c (diff) | |
download | otp-b96f872bba8cbcd87d1e1f4a5caffdb362f45111.tar.gz otp-b96f872bba8cbcd87d1e1f4a5caffdb362f45111.tar.bz2 otp-b96f872bba8cbcd87d1e1f4a5caffdb362f45111.zip |
Handle dead sender at terminate
Diffstat (limited to 'lib/ssl/src/tls_connection.erl')
-rw-r--r-- | lib/ssl/src/tls_connection.erl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl index a4fc45e834..87e7809817 100644 --- a/lib/ssl/src/tls_connection.erl +++ b/lib/ssl/src/tls_connection.erl @@ -367,13 +367,11 @@ send_alert_in_connection(#alert{description = ?CLOSE_NOTIFY} = Alert, State) -> send_alert_in_connection(Alert, #state{protocol_specific = #{sender := Sender}}) -> tls_sender:send_alert(Sender, Alert). -send_sync_alert(Alert, #state{protocol_specific = #{sender := Sender}}= State) -> - tls_sender:send_and_ack_alert(Sender, Alert), - receive - {Sender, ack_alert} -> - ok - after ?DEFAULT_TIMEOUT -> - %% Sender is blocked terminate anyway +send_sync_alert( + Alert, #state{protocol_specific = #{sender := Sender}} = State) -> + try tls_sender:send_and_ack_alert(Sender, Alert) + catch + _:_ -> throw({stop, {shutdown, own_alert}, State}) end. |