W3C home > Mailing lists > Public > ietf-http-wg@w3.org > April to June 2014

Re: Confusing numbering of flags & bits

From: Mike Bishop <Michael.Bishop@microsoft.com>
Date: Sat, 28 Jun 2014 15:11:48 +0000
To: Willy Tarreau <w@1wt.eu>, HTTP Working Group <ietf-http-wg@w3.org>
Message-ID: <0a55f3063edd4ad09271f5d0828eb69b@BL2PR03MB132.namprd03.prod.outlook.com>
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>


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

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:31 UTC