Re: Confusing numbering of flags & bits

Editorial, in my opinion.  File an issue and let Martin deal with it.  But valid feedback, certainly.

Sent from Windows Mail

From: Willy Tarreau<mailto:w@1wt.eu>
Sent: ?Saturday?, ?June? ?28?, ?2014 ?1?:?56? ?AM
To: HTTP Working Group<mailto:ietf-http-wg@w3.org>

Hi,

I'm currently looking at the spec in more details. I find it extremely
confusing that bit numbers for flags are shifted by one, for example :

   ACK (0x1):  Bit 1 being set indicates that this frame acknowledges...

Here I'm obviously tempted to define :

    #define ACK  BIT(1)

with a classical BIT(n)=(1<<(n)). But that's wrong since in fact it's
not bit 1 but bit 0. On some frames which define many flags, it's
easier to guess what's wrong, but on frames which define a single flag,
the mistake is very easy. I don't see any valid reason for numbering
bits in this very unusual way, so I'd suggest we fix this before the
release.

Regards,
Willy

Received on Saturday, 28 June 2014 15:12:20 UTC