Hi Dave, On Tue, Mar 28, 2017 at 03:11:09PM +0000, Dave J wrote: > Hello > > I've been studying the documentation at > http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt and have found > that in the code sample at the bottom there is a bug. This is also present > in version 1.7 of the documentation: i haven't looked any further back than > that. The line > > size = 16 + hdr.v2.len; > > needs to convert the value of hdr.v2.len to a host short, so it should be > > size = 16 + ntohs(hdr.v2.len);
You're totally right. > This isn't a major problem, as when stepping through the code the problem can > be quite quickly spotted, but it just seems a shame to have this little error > spoil what is an excellent example. > > Sorry if this has been mentioned before; I did take a look but couldn't find > any mention of it. It's the first report. Feel free make a patch out of it and to submit it as your first contribution. Please check CONTRIBUTING then run "git log doc/proxy-protocol.txt" to get inspired for your commit message :-) Thanks, Willy

