aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-05-16 14:59:39 +0200
committerIngela Anderton Andin <[email protected]>2017-05-23 09:47:38 +0200
commit5b3a2b854eb537b07127bd6d369521d2f525f6c0 (patch)
tree794ef5947a0435fbd5dedbf17b72c80dadd9d943 /lib
parente577de4216f2dc180aac3e30949804db0b3e817d (diff)
downloadotp-5b3a2b854eb537b07127bd6d369521d2f525f6c0.tar.gz
otp-5b3a2b854eb537b07127bd6d369521d2f525f6c0.tar.bz2
otp-5b3a2b854eb537b07127bd6d369521d2f525f6c0.zip
dtls: Ask for next DTLS record when disregarding future packet
Diffstat (limited to 'lib')
-rw-r--r--lib/ssl/src/dtls_connection.erl16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl
index f078b87bce..01621c68c6 100644
--- a/lib/ssl/src/dtls_connection.erl
+++ b/lib/ssl/src/dtls_connection.erl
@@ -753,28 +753,30 @@ next_event(connection = StateName, no_record,
{State, MoreActions} = send_handshake_flight(State1, Epoch),
{next_state, StateName, State, Actions ++ MoreActions};
{#ssl_tls{epoch = _Epoch,
- version = _Version}, State} ->
+ version = _Version}, State1} ->
%% TODO maybe buffer later epoch
- {next_state, StateName, State, Actions};
+ {Record, State} = next_record(State1),
+ next_event(StateName, Record, State, Actions);
{#alert{} = Alert, State} ->
{next_state, StateName, State, [{next_event, internal, Alert} | Actions]}
end;
next_event(StateName, Record,
- #state{connection_states = #{current_read := #{epoch := CurrentEpoch}}} = State, Actions) ->
+ #state{connection_states = #{current_read := #{epoch := CurrentEpoch}}} = State0, Actions) ->
case Record of
no_record ->
- {next_state, StateName, State, Actions};
+ {next_state, StateName, State0, Actions};
#ssl_tls{epoch = CurrentEpoch,
version = Version} = Record ->
{next_state, StateName,
- dtls_version(StateName, Version, State),
+ dtls_version(StateName, Version, State0),
[{next_event, internal, {protocol_record, Record}} | Actions]};
#ssl_tls{epoch = _Epoch,
version = _Version} = _Record ->
%% TODO maybe buffer later epoch
- {next_state, StateName, State, Actions};
+ {Record, State} = next_record(State0),
+ next_event(StateName, Record, State, Actions);
#alert{} = Alert ->
- {next_state, StateName, State, [{next_event, internal, Alert} | Actions]}
+ {next_state, StateName, State0, [{next_event, internal, Alert} | Actions]}
end.
decode_cipher_text(#state{protocol_buffers = #protocol_buffers{dtls_cipher_texts = [ CT | Rest]} = Buffers,