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
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
* permits to save performances because a systematic
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) {
{
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).
{
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) {
{ 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.
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);
}