MINOR: connection: Remove the multiplexer protocol PROTO_MODE_HTX

Since the legacy HTTP mode is disabled and no multiplexer relies on it anymore,
there is no reason to have 2 multiplexer protocols for the HTTP. So the protocol
PROTO_MODE_HTX was removed and all HTTP multiplexers use now PROTO_MODE_HTTP.
This commit is contained in:
Christopher Faulet 2019-07-15 11:42:52 +02:00
parent 5ed8353dcf
commit c985f6c5d8
6 changed files with 7 additions and 20 deletions

View File

@ -929,10 +929,6 @@ static inline void list_mux_proto(FILE *out)
mode = "TCP";
else if (item->mode == PROTO_MODE_HTTP)
mode = "HTTP";
else if (item->mode == PROTO_MODE_HTX)
mode = "HTX";
else if (item->mode == (PROTO_MODE_HTTP | PROTO_MODE_HTX))
mode = "HTTP|HTX";
else
mode = "NONE";
@ -1043,7 +1039,7 @@ static inline int conn_install_mux_fe(struct connection *conn, void *ctx)
int mode;
if (bind_conf->frontend->mode == PR_MODE_HTTP)
mode = ((bind_conf->frontend->options2 & PR_O2_USE_HTX) ? PROTO_MODE_HTX : PROTO_MODE_HTTP);
mode = PROTO_MODE_HTTP;
else
mode = PROTO_MODE_TCP;
@ -1081,7 +1077,7 @@ static inline int conn_install_mux_be(struct connection *conn, void *ctx, struct
int mode;
if (prx->mode == PR_MODE_HTTP)
mode = ((prx->options2 & PR_O2_USE_HTX) ? PROTO_MODE_HTX : PROTO_MODE_HTTP);
mode = PROTO_MODE_HTTP;
else
mode = PROTO_MODE_TCP;

View File

@ -471,8 +471,7 @@ enum proto_proxy_mode {
PROTO_MODE_NONE = 0,
PROTO_MODE_TCP = 1 << 0, // must not be changed!
PROTO_MODE_HTTP = 1 << 1, // must not be changed!
PROTO_MODE_HTX = 1 << 2, // must not be changed!
PROTO_MODE_ANY = PROTO_MODE_TCP | PROTO_MODE_HTTP, // note: HTX is experimental and must not appear here
PROTO_MODE_ANY = PROTO_MODE_TCP | PROTO_MODE_HTTP,
};
enum proto_proxy_side {

View File

@ -3585,10 +3585,6 @@ int check_config_validity()
int mode = (1 << (curproxy->mode == PR_MODE_HTTP));
const struct mux_proto_list *mux_ent;
/* Special case for HTX because legacy HTTP still exists */
if (mode == PROTO_MODE_HTTP && (curproxy->options2 & PR_O2_USE_HTX))
mode = PROTO_MODE_HTX;
if (!bind_conf->mux_proto)
continue;
@ -3614,10 +3610,6 @@ int check_config_validity()
int mode = (1 << (curproxy->mode == PR_MODE_HTTP));
const struct mux_proto_list *mux_ent;
/* Special case for HTX because legacy HTTP still exists */
if (mode == PROTO_MODE_HTTP && (curproxy->options2 & PR_O2_USE_HTX))
mode = PROTO_MODE_HTX;
if (!newsrv->mux_proto)
continue;

View File

@ -479,7 +479,7 @@ static void h1_release(struct h1c *h1c)
if (h1c->wait_event.events)
conn->xprt->unsubscribe(conn, conn->xprt_ctx,
h1c->wait_event.events, &h1c->wait_event);
if (conn_upgrade_mux_fe(conn, NULL, &h1c->ibuf, ist("h2"), PROTO_MODE_HTX) != -1) {
if (conn_upgrade_mux_fe(conn, NULL, &h1c->ibuf, ist("h2"), PROTO_MODE_HTTP) != -1) {
/* connection successfully upgraded to H2, this
* mux was already released */
return;
@ -2533,7 +2533,7 @@ static const struct mux_ops mux_h1_ops = {
/* this mux registers default HTX proto */
static struct mux_proto_list mux_proto_htx =
{ .token = IST(""), .mode = PROTO_MODE_HTX, .side = PROTO_SIDE_BOTH, .mux = &mux_h1_ops };
{ .token = IST(""), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_BOTH, .mux = &mux_h1_ops };
INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_htx);

View File

@ -5163,7 +5163,7 @@ static const struct mux_ops h2_ops = {
};
static struct mux_proto_list mux_proto_h2 =
{ .token = IST("h2"), .mode = PROTO_MODE_HTX, .side = PROTO_SIDE_BOTH, .mux = &h2_ops };
{ .token = IST("h2"), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_BOTH, .mux = &h2_ops };
INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_h2);

View File

@ -1477,7 +1477,7 @@ int stream_set_backend(struct stream *s, struct proxy *be)
if (s->si[0].wait_event.events)
conn->mux->unsubscribe(cs, s->si[0].wait_event.events,
&s->si[0].wait_event);
if (conn_upgrade_mux_fe(conn, cs, &s->req.buf, ist(""), PROTO_MODE_HTX) == -1)
if (conn_upgrade_mux_fe(conn, cs, &s->req.buf, ist(""), PROTO_MODE_HTTP) == -1)
return 0;
s->flags |= SF_HTX;
}