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.
diff --git a/include/types/connection.h b/include/types/connection.h
index 25d842b..4bcac60 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -255,6 +255,12 @@
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 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 */
};
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 838ce95..4ee20b4 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -3330,6 +3330,7 @@
.detach = h2_detach,
.shutr = h2_shutr,
.shutw = h2_shutw,
+ .flags = MX_FL_CLEAN_ABRT,
.name = "H2",
};
diff --git a/src/mux_pt.c b/src/mux_pt.c
index 71bb477..b32fa8e 100644
--- a/src/mux_pt.c
+++ b/src/mux_pt.c
@@ -214,6 +214,7 @@
.detach = mux_pt_detach,
.shutr = mux_pt_shutr,
.shutw = mux_pt_shutw,
+ .flags = MX_FL_NONE,
.name = "PASS",
};