aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2019-03-19 12:14:43 +0100
committerIngela Anderton Andin <[email protected]>2019-03-19 12:14:43 +0100
commit8c1059c60f07e0acc916967be097a4e5ce15f2c4 (patch)
tree7576c8251c1360e49001569bd2a5f9ff97a65c1c
parent620ac3e68c5bc8b36143965fcf2892a07dc005c4 (diff)
parent18e8014fe2afa454ed644a731f7ddf820b79bb16 (diff)
downloadotp-8c1059c60f07e0acc916967be097a4e5ce15f2c4.tar.gz
otp-8c1059c60f07e0acc916967be097a4e5ce15f2c4.tar.bz2
otp-8c1059c60f07e0acc916967be097a4e5ce15f2c4.zip
Merge branch 'ingela/ssl/recv-timeout-bug/ERL-884/ERL-883/OTP-14701' into maint
* ingela/ssl/recv-timeout-bug/ERL-884/ERL-883/OTP-14701: ssl: Cancel recv timer in all places
-rw-r--r--lib/ssl/src/tls_connection.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index 3229004c9d..2b9f9f1e93 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->