MINOR: mux: add flags to describe a mux's capabilities

This new field will be used to describe certain properties of some
muxes. For now we only add MX_FL_CLEAN_ABRT to indicate that a mux
is able to unambiguously report aborts using CS_FL_ERROR contrary
to others who may only report it via a read0. This will be used to
improve handling of the abortonclose option with H2. Other flags
may come later to report multiplexing capabilities or not, support
of client/server sides etc.
This commit is contained in:
Willy Tarreau 2017-12-20 16:14:44 +01:00
parent 2153d3ce73
commit 28f1cb9da2
3 changed files with 9 additions and 0 deletions

View File

@ -255,6 +255,12 @@ enum {
XPRT_ENTRIES /* must be last one */
};
/* MUX-specific flags */
enum {
MX_FL_NONE = 0x00000000,
MX_FL_CLEAN_ABRT = 0x00000001, /* abort is clearly reported as an error */
};
/* xprt_ops describes transport-layer operations for a connection. They
* generally run over a socket-based control layer, but not always. Some
* of them are used for data transfer with the upper layer (rcv_*, snd_*)
@ -299,6 +305,7 @@ struct mux_ops {
struct conn_stream *(*attach)(struct connection *); /* Create and attach a conn_stream to an outgoing connection */
void (*detach)(struct conn_stream *); /* Detach a conn_stream from an outgoing connection, when the request is done */
unsigned int flags; /* some flags characterizing the mux's capabilities (MX_FL_*) */
char name[8]; /* mux layer name, zero-terminated */
};

View File

@ -3330,6 +3330,7 @@ const struct mux_ops h2_ops = {
.detach = h2_detach,
.shutr = h2_shutr,
.shutw = h2_shutw,
.flags = MX_FL_CLEAN_ABRT,
.name = "H2",
};

View File

@ -214,6 +214,7 @@ const struct mux_ops mux_pt_ops = {
.detach = mux_pt_detach,
.shutr = mux_pt_shutr,
.shutw = mux_pt_shutw,
.flags = MX_FL_NONE,
.name = "PASS",
};