MAJOR: htx: Enable the HTX mode by default for all proxies

The legacy HTTP mode is no more the default one. So now, by default, without any
option in your configuration, all proxies will use the HTX mode. The line
"option http-use-htx" in proxy sections are now useless, except to cancel the
legacy HTTP mode. To fallback on legacy HTTP mode, you should use the line "no
option http-use-htx" explicitly.

Note that the reg-tests still work by default on legacy HTTP mode. The HTX will
be enabled by default in a futur commit.
This commit is contained in:
Christopher Faulet 2019-04-12 16:10:51 +02:00
parent 0ef372a390
commit 1d2b586cdd
3 changed files with 19 additions and 16 deletions

View File

@ -6224,28 +6224,28 @@ no option http-use-htx
yes | yes | yes | yes yes | yes | yes | yes
Arguments : none Arguments : none
By default, the HTTP protocol is processed as-is. Inserting, deleting, or Historically, the HTTP protocol is processed as-is. Inserting, deleting, or
modifying a header field requires to rewrite the affected part in the buffer modifying a header field requires to rewrite the affected part in the buffer
and to move the buffer's tail accordingly. Since this principle has deep and to move the buffer's tail accordingly. This mode is known as the legacy
roots in haproxy, the HTTP/2 protocol is converted to HTTP/1.1 before being HTTP mode. Since this principle has deep roots in haproxy, the HTTP/2
processed this way. It also results in the inability to establish HTTP/2 protocol is converted to HTTP/1.1 before being processed this way. It also
connections to servers because of the loss of HTTP/2 semantics in the HTTP/1 results in the inability to establish HTTP/2 connections to servers because
representation. of the loss of HTTP/2 semantics in the HTTP/1 representation.
HTX is the name of a totally new native internal representation for the HTTP HTX is the name of a totally new native internal representation for the HTTP
protocol, that is agnostic to the version and aims at preserving semantics protocol, that is agnostic to the version and aims at preserving semantics
all along the chain. It relies on a fast parsing, tokenizing and indexing of all along the chain. It relies on a fast parsing, tokenizing and indexing of
the protocol elements so that no more memory moves are necessary and that the protocol elements so that no more memory moves are necessary and that
most elements are directly accessed. This mechanism is still limited to the most elements are directly accessed. It supports using either HTTP/1 or
most basic operations (no compression, filters, Lua, applets, cache, etc). HTTP/2 on any side regardless of the other side's version. It also supports
But it supports using either HTTP/1 or HTTP/2 on any side regardless of the upgrades from TCP to HTTP and implicit ones from HTTP/1 to HTTP/2 (matching
other side's version. the HTTP/2 preface).
This option indicates that HTX needs to be used. It will cause errors to be This option indicates that HTX needs to be used. Since the version 2.0-dev3,
emitted if incompatible features are used, but will allow H2 to be selected the HTX is the default mode. To switch back on the legacy HTTP mode, the
as a server protocol. It is recommended to use this option on new reasonably option must be explicitly disabled using the "no" prefix. For prior versions,
simple configurations, but since the feature still has incomplete functional the feature has incomplete functional coverage, so it is not enabled by
coverage, it is not enabled by default. default.
See also : "mode http" See also : "mode http"

View File

@ -302,7 +302,7 @@ jobcount=""
verbose="-q" verbose="-q"
debug="" debug=""
keep_logs="-l" keep_logs="-l"
no_htx="#" no_htx="no "
testlist="" testlist=""
_process "$@"; _process "$@";

View File

@ -820,6 +820,9 @@ void init_new_proxy(struct proxy *p)
/* initial uuid is unassigned (-1) */ /* initial uuid is unassigned (-1) */
p->uuid = -1; p->uuid = -1;
/* HTX is the default mode, for HTTP and TCP */
p->options2 |= PR_O2_USE_HTX;
HA_SPIN_INIT(&p->lock); HA_SPIN_INIT(&p->lock);
} }