projects
/
haproxy-2.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5ae702
)
DOC: update sample code for PROXY protocol
author
Glenn Strauss
<gstrauss@gluelogic.com>
Wed, 5 Apr 2017 05:37:20 +0000
(
01:37
-0400)
committer
Willy Tarreau
<w@1wt.eu>
Wed, 5 Apr 2017 06:41:17 +0000
(08:41 +0200)
lengths are in network byte order so use ntohs(hdr.v2.len)
when calculating size of v2 header to recv() from head of stream.
doc/proxy-protocol.txt
patch
|
blob
|
history
diff --git
a/doc/proxy-protocol.txt
b/doc/proxy-protocol.txt
index
e7888f6
..
358bce0
100644
(file)
--- a/
doc/proxy-protocol.txt
+++ b/
doc/proxy-protocol.txt
@@
-970,7
+970,7
@@
side is even simpler and can easily be deduced from this sample code.
if (ret >= 16 && memcmp(&hdr.v2, v2sig, 12) == 0 &&
(hdr.v2.ver_cmd & 0xF0) == 0x20) {
- size = 16 + hdr.v2.len;
+ size = 16 + ntohs(hdr.v2.len);
if (ret < size)
return -1; /* truncated or too large header */