]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MEDIUM] separate protocol-level accept() from the frontend's
authorWilly Tarreau <w@1wt.eu>
Fri, 28 May 2010 16:46:57 +0000 (18:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Jun 2010 08:53:11 +0000 (10:53 +0200)
commiteb472685cbdf1e4c2c11e9ee01b3b49c3279262c
tree284d0f92ae45c4e0ebab1a124c69beefcd5f6c83
parent03fa5df64aaf6f854235db2c0b481273c69a7e47
[MEDIUM] separate protocol-level accept() from the frontend's

For a long time we had two large accept() functions, one for TCP
sockets instanciating proxies, and another one for UNIX sockets
instanciating the stats interface.

A lot of code was duplicated and both did not work exactly the same way.

Now we have a stream_sock layer accept() called for either TCP or UNIX
sockets, and this function calls the frontend-specific accept() function
which does the rest of the frontend-specific initialisation.

Some code is still duplicated (session & task allocation, stream interface
initialization), and might benefit from having an intermediate session-level
accept() callback to perform such initializations. Still there are some
minor differences that need to be addressed first. For instance, the monitor
nets should only be checked for proxies and not for other connection templates.

Last, we renamed l->private as l->frontend. The "private" pointer in
the listener is only used to store a frontend, so let's rename it to
eliminate this ambiguity. When we later support detached listeners
(eg: FTP), we'll add another field to avoid the confusion.
12 files changed:
include/proto/dumpstats.h
include/proto/frontend.h
include/proto/proto_tcp.h
include/proto/proto_uxst.h
include/proto/stream_sock.h
include/types/protocols.h
src/cfgparse.c
src/dumpstats.c
src/frontend.c
src/proto_tcp.c
src/proto_uxst.c
src/stream_sock.c