Subject: Confusing numbering of flags & bits

From: Willy Tarreau <[email-masked]>
Date: Sat, 28 Jun 2014 10:52:43 +0200

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

---

From: Mike Bishop <[email-masked]>
Date: Sat, 28 Jun 2014 15:11:48 +0000

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:[email-masked]>
Sent: ?Saturday?, ?June? ?28?, ?2014 ?1?:?56? ?AM
To: HTTP Working Group<mailto:[email-masked]>

Hi,

    #define ACK  BIT(1)

Regards,
Willy