mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-29 14:01:50 +01:00
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.