diff options
author | Erlang/OTP <[email protected]> | 2019-03-18 18:02:32 +0100 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-03-18 18:02:32 +0100 |
commit | 18940986f9539370efb6e3a2be53ec312c6445bf (patch) | |
tree | 45438da8aa3dda125c4eee6efb3e8f5a61e84dff /lib/ssl/src/tls_connection.erl | |
parent | 7b4f3319aa8cbe242c5e0ad7ef9730a3727a1333 (diff) | |
parent | 18e8014fe2afa454ed644a731f7ddf820b79bb16 (diff) | |
download | otp-18940986f9539370efb6e3a2be53ec312c6445bf.tar.gz otp-18940986f9539370efb6e3a2be53ec312c6445bf.tar.bz2 otp-18940986f9539370efb6e3a2be53ec312c6445bf.zip |
Merge branch 'ingela/ssl/recv-timeout-bug/ERL-884/ERL-883/OTP-14701' into maint-21
* ingela/ssl/recv-timeout-bug/ERL-884/ERL-883/OTP-14701:
ssl: Cancel recv timer in all places
Diffstat (limited to 'lib/ssl/src/tls_connection.erl')
-rw-r--r-- | lib/ssl/src/tls_connection.erl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl index 31173703d2..114710a92e 100644 --- a/lib/ssl/src/tls_connection.erl +++ b/lib/ssl/src/tls_connection.erl @@ -223,7 +223,22 @@ next_event(StateName, Record, State, Actions) -> %%% TLS record protocol level application data messages - +handle_protocol_record(#ssl_tls{type = ?APPLICATION_DATA, fragment = Data}, StateName, + #state{start_or_recv_from = From, + socket_options = #socket_options{active = false}} = State0) when From =/= undefined -> + case ssl_connection:read_application_data(Data, State0) of + {stop, _, _} = Stop-> + Stop; + {Record, #state{start_or_recv_from = Caller} = State1} -> + TimerAction = case Caller of + undefined -> %% Passive recv complete cancel timer + [{{timeout, recv}, infinity, timeout}]; + _ -> + [] + end, + {next_state, StateName, State, Actions} = next_event(StateName, Record, State1, TimerAction), + ssl_connection:hibernate_after(StateName, State, Actions) + end; handle_protocol_record(#ssl_tls{type = ?APPLICATION_DATA, fragment = Data}, StateName, State0) -> case ssl_connection:read_application_data(Data, State0) of {stop, _, _} = Stop-> |