]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: connection: start to introduce a mux layer between xprt and data
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Aug 2017 08:53:00 +0000 (10:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 17:03:23 +0000 (18:03 +0100)
commit53a4766e400aa60835b6994c67100aaa0b936017
treede56989b92894df54a90a2f4a826a1442a73af14
parentd7bddda1517ee870381528f8c49f97a41b201d89
MEDIUM: connection: start to introduce a mux layer between xprt and data

For HTTP/2 and QUIC, we'll need to deal with multiplexed streams inside
a connection. After quite a long brainstorming, it appears that the
connection interface to the existing streams is appropriate just like
the connection interface to the lower layers. In fact we need to have
the mux layer in the middle of the connection, between the transport
and the data layer.

A mux can exist on two directions/sides. On the inbound direction, it
instanciates new streams from incoming connections, while on the outbound
direction it muxes streams into outgoing connections. The difference is
visible on the mux->init() call : in one case, an upper context is already
known (outgoing connection), and in the other case, the upper context is
not yet known (incoming connection) and will have to be allocated by the
mux. The session doesn't have to create the new streams anymore, as this
is performed by the mux itself.

This patch introduces this and creates a pass-through mux called
"mux_pt" which is used for all new connections and which only
calls the data layer's recv,send,wake() calls. One incoming stream
is immediately created when init() is called on the inbound direction.
There should not be any visible impact.

Note that the connection's mux is purposely not set until the session
is completed so that we don't accidently run with the wrong mux. This
must not cause any issue as the xprt_done_cb function is always called
prior to using mux's recv/send functions.
Makefile
include/proto/connection.h
include/proto/mux_pt.h [new file with mode: 0644]
include/types/connection.h
src/backend.c
src/checks.c
src/connection.c
src/mux_pt.c [new file with mode: 0644]
src/peers.c
src/session.c
src/stream.c