MINOR: lua/htx: Forbid lua usage when the HTX is enabled on a proxy

For now, the lua scripts are not compatible with the new HTX internal
representation of HTTP messages. Thus, for a given proxy, when the option
"http-use-htx" is enabled, an error is triggered if any lua's
action/service/sample-fetch/converter is also configured.
diff --git a/src/hlua.c b/src/hlua.c
index 2364317..33bf71e 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -5756,6 +5756,11 @@
 	if (!stream)
 		return 0;
 
+	if (IS_HTX_STRM(stream)) {
+		SEND_ERR(stream->be, "Lua converter '%s': Lua fetches cannot be used when the"
+			 " HTX internal representation is enabled.\n", fcn->name);
+		return 0;
+	}
 	/* In the execution wrappers linked with a stream, the
 	 * Lua context can be not initialized. This behavior
 	 * permits to save performances because a systematic
@@ -5887,6 +5892,12 @@
 
 	if (!stream)
 		return 0;
+
+	if (IS_HTX_STRM(stream)) {
+		SEND_ERR(stream->be, "Lua sample-fetch '%s': Lua fetches cannot be used when the"
+			 " HTX internal representation is enabled.\n", fcn->name);
+		return 0;
+	}
 
 	/* In the execution wrappers linked with a stream, the
 	 * Lua context can be not initialized. This behavior
@@ -6833,6 +6844,11 @@
 	struct hlua_function *fcn = rule->kw->private;
 	int i;
 
+	if (px->options2 & PR_O2_USE_HTX) {
+		memprintf(err, "Lua actions cannot be used when the HTX internal representation is enabled");
+		return ACT_RET_PRS_ERR;
+	}
+
 	/* Memory for the rule. */
 	rule->arg.hlua_rule = calloc(1, sizeof(*rule->arg.hlua_rule));
 	if (!rule->arg.hlua_rule) {
@@ -6875,6 +6891,11 @@
 {
 	struct hlua_function *fcn = rule->kw->private;
 
+	if (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;
+	}
+
 	/* HTTP applets are forbidden in tcp-request rules.
 	 * HTTP applet request requires everything initilized by
 	 * "http_process_request" (analyzer flag AN_REQ_HTTP_INNER).
@@ -7007,6 +7028,11 @@
 {
 	struct hlua_function *fcn = rule->kw->private;
 
+	if (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;
+	}
+
 	/* Memory for the rule. */
 	rule->arg.hlua_rule = calloc(1, sizeof(*rule->arg.hlua_rule));
 	if (!rule->arg.hlua_rule) {
@@ -7494,6 +7520,34 @@
 	{ 0, NULL, NULL },
 }};
 
+static int hlua_check_config()
+{
+	struct proxy *px;
+	struct acl *acl;
+	struct acl_expr *expr;
+	struct sample_fetch *fetch;
+	int err = 0;
+
+	for (px = proxies_list; px; px = px->next) {
+		if (!(px->options2 & PR_O2_USE_HTX))
+			continue;
+
+		list_for_each_entry(acl, &px->acl, list) {
+			list_for_each_entry(expr, &acl->expr, list) {
+				fetch = expr->smp->fetch;
+				if (fetch->process != hlua_sample_fetch_wrapper)
+					continue;
+
+				ha_alert("config: %s '%s': sample-fetch '%s' cannot be used used "
+					 "when the HTX internal representation is enabled.\n",
+					 proxy_type_str(px), px->id, fetch->kw);
+				err++;
+			}
+		}
+	}
+	return err;
+}
+
 /* This function can fail with an abort() due to an Lua critical error.
  * We are in the initialisation process of HAProxy, this abort() is
  * tolerated.
@@ -8161,4 +8215,5 @@
 	char *ptr = NULL;
 	memprintf(&ptr, "Built with Lua version : %s", LUA_RELEASE);
 	hap_register_build_opts(ptr, 1);
+	cfg_register_postparser("hlua", hlua_check_config);
 }