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.
diff --git a/src/hlua.c b/src/hlua.c
index dd9fc00..98c434a 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -7714,7 +7714,7 @@
{
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;
}
diff --git a/src/proxy.c b/src/proxy.c
index be81059..8c4b2f2 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -111,7 +111,7 @@
{ "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 }
};