diff options
author | Ingela Anderton Andin <[email protected]> | 2019-05-06 16:04:59 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2019-05-06 16:04:59 +0200 |
commit | 5e639dba012a2701eaf74cbbbf0cdc301c070266 (patch) | |
tree | fe741dfca164ed0f7f30aa96e708d63e72c97f72 | |
parent | 3e898a8cdc87cadaa949960b7b042c5266c63791 (diff) | |
parent | 6e190b012dd5a304fc42a5f3bb58ff173a23eb66 (diff) | |
download | otp-5e639dba012a2701eaf74cbbbf0cdc301c070266.tar.gz otp-5e639dba012a2701eaf74cbbbf0cdc301c070266.tar.bz2 otp-5e639dba012a2701eaf74cbbbf0cdc301c070266.zip |
Merge branch 'ingela/ssl/flow-ctrl/ERL-934/OTP-15802' into maint
* ingela/ssl/flow-ctrl/ERL-934/OTP-15802:
ssl: Add check when to toggle internal active N
-rw-r--r-- | lib/ssl/src/tls_connection.erl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl index 167a99b418..52e5db731a 100644 --- a/lib/ssl/src/tls_connection.erl +++ b/lib/ssl/src/tls_connection.erl @@ -152,19 +152,21 @@ next_record(#state{protocol_buffers = connection_states = ConnectionStates, ssl_options = #ssl_options{padding_check = Check}} = State) -> next_record(State, CipherTexts, ConnectionStates, Check); -next_record(#state{protocol_buffers = #protocol_buffers{tls_cipher_texts = []}, - protocol_specific = #{active_n_toggle := true, active_n := N} = ProtocolSpec, +next_record(#state{user_data_buffer = {_,0,_}, + protocol_buffers = #protocol_buffers{tls_cipher_texts = []}, + protocol_specific = #{active_n_toggle := true, + active_n := N} = ProtocolSpec, static_env = #static_env{socket = Socket, close_tag = CloseTag, transport_cb = Transport} - } = State) -> + } = State) -> case tls_socket:setopts(Transport, Socket, [{active, N}]) of ok -> - {no_record, State#state{protocol_specific = ProtocolSpec#{active_n_toggle => false}}}; + {no_record, State#state{protocol_specific = ProtocolSpec#{active_n_toggle => false}}}; _ -> - self() ! {CloseTag, Socket}, - {no_record, State} - end; + self() ! {CloseTag, Socket}, + {no_record, State} + end; next_record(State) -> {no_record, State}. |