]> git.kaiwu.me - haproxy.git/commit
[MEDIUM] stream_interface: store the target pointer and type
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Mar 2011 21:04:29 +0000 (22:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 10 Mar 2011 22:32:15 +0000 (23:32 +0100)
commitac82540c3547624887e2901928f549c84c0c6892
treeedb7b91a4678a5e5608a406abc09d879f92a5236
parentf153686a7101432de2df8befab6264e82962d9c1
[MEDIUM] stream_interface: store the target pointer and type

When doing a connect() on a stream interface, some information is needed
from the server and from the backend. In some situations, we don't have
a server and only a backend (eg: peers). In other cases, we know we have
an applet and we don't want to connect to anything, but we'd still like
to have the info about the applet being used.

For this, we now store a pointer to the "target" into the stream interface.
The target describes what's on the other side before trying to connect. It
can be a server, a proxy or an applet for now. Later we'll probably have
descriptors for multiple-stage chains so that the final information may
still be found.

This will help removing many specific cases in the code. It already made
it possible to remove the "srv" and "be" parameters to tcpv4_connect_server().
include/proto/proto_tcp.h
include/types/stream_interface.h
src/backend.c
src/peers.c
src/proto_tcp.c
src/session.c
src/stream_interface.c