Subject: [quicwg/base-drafts] Pseudo-code for SetLossDetectionTimer looks odd (#2906)

From: Jeremy Lainé <[email-masked]>
Date: Wed, 17 Jul 2019 14:03:37 -0700

The pseudo-code for `SetLossDetectionTimer` contains the following:

```
  // Don't arm timer if there are no ack-eliciting packets
  // in flight and the handshake is complete.
  if (endpoint is client with 1-RTT keys &&
      no ack-eliciting packets in flight):
    loss_detection_timer.cancel()
    return
```

Unless I'm mistaken the first condition of the `if` doesn't match the comment. I don't think we should be re-arming the timer in the following conditions:

- server without 1-RTT keys and no ack-eliciting packets in flight
- server with 1-RTT keys and no ack-eliciting packets in flight

It's not beautiful but the `if` should probably be more like:

```
    if (no ack-eliciting packets in flight && (endpoint is server or has 1-RTT keys)):
```

Thoughts @ianswett ?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/2906

---

From: ianswett <[email-masked]>
Date: Wed, 17 Jul 2019 15:49:50 -0700

You're right, it's now subtly incorrect and your suggestion is a good one.  See PR #2907

I'm not sure the updated comment is that useful given the verbosity of the pseudocode, but suggestions are welcome.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/2906#issuecomment-512596969