Hi Richard,
On Tue, Jun 10, 2014 at 05:22:40PM -0700, Richard Russo wrote:
> Hi,
>
> The sample code provided at the end of the proxy protocol documentation [1]
> doesn't match the description earlier in the doc. Specifically the header
> is described as:
>
> struct proxy_hdr_v2 {
> uint8_t sig[12]; /* hex 0D 0A 0D 0A 00 0D 0A 51 55 49 54 0A */
> uint8_t ver; /* protocol version and command */
> uint8_t fam; /* protocol family and address */
> uint16_t len; /* number of following bytes part of the header */
> };
>
>
> but then the code later has
>
> uint8_t sig[12];
>
> uint8_t ver;
> uint8_t cmd;
> uint8_t fam;
> uint8_t len;
>
> Can you take a look; I think there may be some other adjustments needed to
> the sample code other than just fixing the structure.
Hmmm yes you're right. We tried to be careful but not enough apparently.
I just checked and haproxy uses the same as the first one you quoted.
I just updated it in the code and on the site. Thank you for reporting
this issue!
Willy