MEDIUM: htx: Allow the option http-use-htx to be used on TCP proxies too

This will be mandatory to allow upgrades from TCP to HTTP in HTX. Of course, raw
buffers will still be used by default on TCP proxies, this option sets or
not. But if you want to handle mux upgrades from a TCP proxy, you must enable
the HTX on it and on all its backends.

There is only a small change in the lua code. Because TCP proxies can be HTX
aware, to exclude TCP services only for HTTP proxies, we must also check the
mode (TCP/HTTP) now.
This commit is contained in:
Christopher Faulet 2019-04-11 22:04:08 +02:00
parent c0016d8119
commit eb7098035c
2 changed files with 2 additions and 2 deletions

View File

@ -7714,7 +7714,7 @@ static enum act_parse_ret action_register_service_tcp(const char **args, int *cu
{
struct hlua_function *fcn = rule->kw->private;
if (px->options2 & PR_O2_USE_HTX) {
if (px->mode == PR_MODE_HTTP && (px->options2 & PR_O2_USE_HTX)) {
memprintf(err, "Lua services cannot be used when the HTX internal representation is enabled");
return ACT_RET_PRS_ERR;
}

View File

@ -111,7 +111,7 @@ const struct cfg_opt cfg_opts2[] =
{ "http-use-proxy-header", PR_O2_USE_PXHDR, PR_CAP_FE, 0, PR_MODE_HTTP },
{ "http-pretend-keepalive", PR_O2_FAKE_KA, PR_CAP_BE, 0, PR_MODE_HTTP },
{ "http-no-delay", PR_O2_NODELAY, PR_CAP_FE|PR_CAP_BE, 0, PR_MODE_HTTP },
{ "http-use-htx", PR_O2_USE_HTX, PR_CAP_FE|PR_CAP_BE, 0, PR_MODE_HTTP },
{ "http-use-htx", PR_O2_USE_HTX, PR_CAP_FE|PR_CAP_BE, 0, 0 },
{ NULL, 0, 0, 0 }
};