Skip to content

Commit

Permalink
Merge branch 'ingela/ssl/maint-21/recv-timeout-flow-ctrl-bug/ERL-1213…
Browse files Browse the repository at this point in the history
…/OTP-16619' into maint-21

* ingela/ssl/maint-21/recv-timeout-flow-ctrl-bug/ERL-1213/OTP-16619:
  ssl: Fix timing bug with ssl:recv and socket passive message
  • Loading branch information
Erlang/OTP committed Apr 24, 2020
2 parents e9acc22 + f7852ad commit ff6023d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/ssl/src/tls_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -917,10 +917,18 @@ handle_info({Protocol, _, Data}, StateName,
handle_info({PassiveTag, Socket}, StateName,
#state{static_env = #static_env{socket = Socket,
passive_tag = PassiveTag},
start_or_recv_from = From,
protocol_buffers = #protocol_buffers{tls_cipher_texts = CTs},
protocol_specific = PS
} = State) ->
next_event(StateName, no_record,
State#state{protocol_specific = PS#{active_n_toggle => true}});
} = State0) ->
case (From =/= undefined) andalso (CTs == []) of
true ->
{Record, State} = activate_socket(State0#state{protocol_specific = PS#{active_n_toggle => true}}),
next_event(StateName, Record, State);
false ->
next_event(StateName, no_record,
State0#state{protocol_specific = PS#{active_n_toggle => true}})
end;
handle_info({CloseTag, Socket}, StateName,
#state{static_env = #static_env{socket = Socket, close_tag = CloseTag},
connection_env = #connection_env{negotiated_version = Version},
Expand Down

0 comments on commit ff6023d

Please sign in to comment.