]> git.ipfire.org Git - thirdparty/haproxy.git/commit
REORG: move the send-proxy code to tcp_connect_write()
authorWilly Tarreau <w@1wt.eu>
Sun, 20 May 2012 16:35:19 +0000 (18:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 20 May 2012 16:35:19 +0000 (18:35 +0200)
commita190d591fcb9d3db8dfe5905bcd879770f473c5b
treeaf03306414aaf5e04bfffe50d1581ef13a4090a0
parent8ae52cb144f62de7700147c6e8da8454e8d5d288
REORG: move the send-proxy code to tcp_connect_write()

It is much better and more efficient to consider that the send-proxy
feature is part of the protocol layer than part of the data layer.
Now the connection is considered established once the send-proxy line
has been sent.

This way the data layer doesn't have to care anymore about this specific
part.

The tcp_connect_write() function now automatically calls the data layer
write() function once the connection is established, which saves calls
to epoll_ctl/epoll_wait/process_session.

It's starting to look more and more obvious that tcp_connect_read() and
tcp_connect_write() are not TCP-specific but only socket-specific and as
such should probably move, along with some functions from protocol.c, to
a socket-specific file (eg: stream_sock).

It would be nice to be able to support autonomous listeners to parse the
proxy protocol before accepting a connection, so that we get rid of it
at the session layer and to support using these informations in the
tcp-request connection rules.
src/proto_tcp.c
src/sock_raw.c