aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-11-29 11:40:49 +0100
committerIngela Anderton Andin <[email protected]>2017-11-29 11:40:49 +0100
commitb965516e672be74bf7c6b13c64a2b916d1dfa217 (patch)
tree21aaae4df39a906cbd39c9344f06e11e7dd06f7d /lib/ssl/src
parenta8d9ed7566d571dc234891517ab95818a3d1b516 (diff)
parent9064b82ad2013d69b4013c7874f02dfc5ae7a675 (diff)
downloadotp-b965516e672be74bf7c6b13c64a2b916d1dfa217.tar.gz
otp-b965516e672be74bf7c6b13c64a2b916d1dfa217.tar.bz2
otp-b965516e672be74bf7c6b13c64a2b916d1dfa217.zip
Merge branch 'ingela/ssl/ERL-521/OTP-14794' into maint
* ingela/ssl/ERL-521/OTP-14794: ssl: Make sure all possible data is delivered
Diffstat (limited to 'lib/ssl/src')
-rw-r--r--lib/ssl/src/tls_connection.erl9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index 3137643aa9..b033eea261 100644
--- a/lib/ssl/src/tls_connection.erl
+++ b/lib/ssl/src/tls_connection.erl
@@ -141,12 +141,14 @@ next_record(#state{protocol_buffers =
end;
next_record(#state{protocol_buffers = #protocol_buffers{tls_packets = [], tls_cipher_texts = []},
socket = Socket,
+ close_tag = CloseTag,
transport_cb = Transport} = State) ->
case tls_socket:setopts(Transport, Socket, [{active,once}]) of
ok ->
{no_record, State};
_ ->
- {socket_closed, State}
+ self() ! {CloseTag, Socket},
+ {no_record, State}
end;
next_record(State) ->
{no_record, State}.
@@ -154,15 +156,10 @@ next_record(State) ->
next_event(StateName, Record, State) ->
next_event(StateName, Record, State, []).
-next_event(StateName, socket_closed, State, _) ->
- ssl_connection:handle_normal_shutdown(?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), StateName, State),
- {stop, {shutdown, transport_closed}, State};
next_event(connection = StateName, no_record, State0, Actions) ->
case next_record_if_active(State0) of
{no_record, State} ->
ssl_connection:hibernate_after(StateName, State, Actions);
- {socket_closed, State} ->
- next_event(StateName, socket_closed, State, Actions);
{#ssl_tls{} = Record, State} ->
{next_state, StateName, State, [{next_event, internal, {protocol_record, Record}} | Actions]};
{#alert{} = Alert, State} ->