Subject: [quicwg/base-drafts] Why are error codes not a varint? (#1940)

From: Marten Seemann <[email-masked]>
Date: Tue, 30 Oct 2018 20:48:02 -0700

The error codes in CONNECTION_CLOSE and RST_STREAM frames are uint16s. That's inconsistent with how we encode pretty much every other value.

While saving bytes is not the reason I'm opening this issue, depending on how frequently streams are reset, it might be nice to save a byte on the error code as well.

-- 
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/1940

---

From: Kazuho Oku <[email-masked]>
Date: Wed, 31 Oct 2018 00:52:40 -0700

I think there are pros and cons in using a varint.

The pro is that we'd have a chance to save an octet as have been pointed out.

The cons that I see are:
* It would not give us any benefit when the application protocol defines error codes in groups (e.g., upper 8 bits indicate the category of the error and lower 8 bits indicate the details). To generalize, I am not sure if we can anticipate that the number space will be used from 0 and onwards unlike other variables that we send.
* It is a bit strange to state that an error code is a *62*-bit variable rather than a type that uses a multiple of 8-bits.

I do not have a strong opinion but considering the cons sticking with `uint16_t` is not too strange to me.

-- 
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/1940#issuecomment-434592735

---

From: ianswett <[email-masked]>
Date: Wed, 31 Oct 2018 04:07:13 -0700

I tend to agree with you, and as a related point, I never understood why we moved off 32 bit error codes, but I also don't think it ends up mattering much so I'm not itching to change it at this point.

If others want to, that's fine with me, since updating from uint16 to varint is easy, but it does seem a bit late for this change in v1.

-- 
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/1940#issuecomment-434646913

---

From: Martin Thomson <[email-masked]>
Date: Wed, 31 Oct 2018 18:06:21 -0700

When I did the varint transition, I chose a fixed size for error codes because they don't represent something that increases, but are more an enumeration.  With the change to varint frame types, that argument doesn't hold any more.  I'm not complete opposed to the idea of varint here, but I would request that a PR be presented before we meet.

@marten-seemann, you have time on the agenda for talking about varint transport parameters.  I won't object if you asked about this at the same time.  Though anyone might reasonably object to a change, I don't think it's fair to deny the discussion.  Particularly if it can be kept short.

-- 
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/1940#issuecomment-434897480