]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MEDIUM] stream_sock: add support for sending the proxy protocol header line
authorWilly Tarreau <w@1wt.eu>
Sun, 20 Mar 2011 09:16:46 +0000 (10:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 20 Mar 2011 09:16:46 +0000 (10:16 +0100)
commitb22e55bc8f06b6679aa5e71c3a73c0f61256f960
treec56a9f7b99e2241d436b71e35757d45aeceaba8a
parenta73fcaf424ee8985abbec1d57b88c3a74f8198c5
[MEDIUM] stream_sock: add support for sending the proxy protocol header line

Upon connection establishment, stream_sock is now able to send a PROXY
line before sending any data. Since it's possible that the buffer is
already full, and we don't want to allocate a block for that line, we
compute it on-the-fly when we need it. We just store the offset from
which to (re-)send from the end of the line, since it's assumed that
multiple outputs of the same proxy line will be strictly equivalent. In
practice, one call is enough. We just make sure to handle the case where
the first send() would indicate an incomplete output, eventhough it's
very unlikely to ever happen.
include/types/stream_interface.h
src/stream_sock.c