Skip to content

Commit

Permalink
Add PeerAwaitingAddressValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
ianswett committed Sep 4, 2019
1 parent 26119bd commit ec34d08
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions draft-ietf-quic-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -1184,21 +1184,20 @@ GetEarliestLossTime():
space = pn_space
return time, space

PeerAwaitingAddressValidation():
return endpoint is client &&
!(has received Handshake ACK ||
has received 1-RTT ACK)

This comment has been minimized.

Copy link
@martinthomson

martinthomson Sep 4, 2019

Member

As a code reviewer, I would then suggest:

  if endpoint is server:
    return false
  return !(has received Handshake ACK ||
           has received 1-RTT ACK)

Edit: Fixed logic inversion. This is hard.

Edit(2): Maybe invert the whole thing (here and below)

PeerHasValidatedMyAddress():
  if endpoint is server:
    return true
  return has received Handshake ACK ||
           has received 1-RTT ACK
...

  if (no ack-eliciting packets in flight &&
      PeerHasValidatedMyAddress()): 

SetLossDetectionTimer():
loss_time, _ = GetEarliestLossTime()
if (loss_time != 0):
// Time threshold loss detection.
loss_detection_timer.update(loss_time)
return

// Cancel the timer if there are no ack-eliciting packets
// in flight, with the following exception: Do not cancel the
// timer at a client until it has received an acknowledgement
// indicating the server has completed address validation.
if (no ack-eliciting packets in flight &&
(endpoint is server ||
has received Handshake ACK ||
has received 1-RTT ACK)):
!PeerAwaitingAddressValidation()):
loss_detection_timer.cancel()
return

Expand Down

0 comments on commit ec34d08

Please sign in to comment.