aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/tls_connection.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2019-01-15 19:35:03 +0100
committerErlang/OTP <[email protected]>2019-01-15 19:35:03 +0100
commit788b9bd0d7ef518fb58fe70793357eec47cd8671 (patch)
treec0ab18180c8c48f4d541e1ca3a1cf0757f2c2da5 /lib/ssl/src/tls_connection.erl
parent1ba335f996b43da22e36eda25819019efaa3122d (diff)
parenta1e2f6e6789e804a56b795905f56b891b21c738e (diff)
downloadotp-788b9bd0d7ef518fb58fe70793357eec47cd8671.tar.gz
otp-788b9bd0d7ef518fb58fe70793357eec47cd8671.tar.bz2
otp-788b9bd0d7ef518fb58fe70793357eec47cd8671.zip
Merge branch 'ingela/maint-21/active-once/ERL-371/OTP-15504' into maint-21
* ingela/maint-21/active-once/ERL-371/OTP-15504: ssl: Guarantee active once data delivery
Diffstat (limited to 'lib/ssl/src/tls_connection.erl')
-rw-r--r--lib/ssl/src/tls_connection.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index 798b853026..80a8c6b72c 100644
--- a/lib/ssl/src/tls_connection.erl
+++ b/lib/ssl/src/tls_connection.erl
@@ -901,6 +901,12 @@ handle_alerts([], Result) ->
Result;
handle_alerts(_, {stop, _, _} = Stop) ->
Stop;
+handle_alerts([#alert{level = ?WARNING, description = ?CLOSE_NOTIFY} | _Alerts],
+ {next_state, connection = StateName, #state{user_data_buffer = Buffer,
+ protocol_buffers = #protocol_buffers{tls_cipher_texts = CTs}} =
+ State}) when (Buffer =/= <<>>) orelse
+ (CTs =/= []) ->
+ {next_state, StateName, State#state{terminated = true}};
handle_alerts([Alert | Alerts], {next_state, StateName, State}) ->
handle_alerts(Alerts, ssl_connection:handle_alert(Alert, StateName, State));
handle_alerts([Alert | Alerts], {next_state, StateName, State, _Actions}) ->