MINOR: connections: Add a new mux method, "takeover".

Add a new mux method, "takeover", that will attempt to make the current thread
responsible for the connection.
It should return 0 on success, and non-zero on failure.
This commit is contained in:
Olivier Houchard 2020-02-19 17:18:57 +01:00 committed by Olivier Houchard
parent 8851664293
commit 00bdce24d5

View File

@ -369,6 +369,7 @@ struct mux_ops {
void (*reset)(struct connection *conn); /* Reset the mux, because we're re-trying to connect */ void (*reset)(struct connection *conn); /* Reset the mux, because we're re-trying to connect */
const struct cs_info *(*get_cs_info)(struct conn_stream *cs); /* Return info on the specified conn_stream or NULL if not defined */ const struct cs_info *(*get_cs_info)(struct conn_stream *cs); /* Return info on the specified conn_stream or NULL if not defined */
int (*ctl)(struct connection *conn, enum mux_ctl_type mux_ctl, void *arg); /* Provides informations about the mux */ int (*ctl)(struct connection *conn, enum mux_ctl_type mux_ctl, void *arg); /* Provides informations about the mux */
int (*takeover)(struct connection *conn); /* Attempts to migrate the connection to the current thread */
unsigned int flags; /* some flags characterizing the mux's capabilities (MX_FL_*) */ unsigned int flags; /* some flags characterizing the mux's capabilities (MX_FL_*) */
char name[8]; /* mux layer name, zero-terminated */ char name[8]; /* mux layer name, zero-terminated */
}; };