]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: lua: Remove any ambiguities about lua txn execution context flags
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 25 Oct 2021 09:41:53 +0000 (11:41 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 27 Oct 2021 09:04:16 +0000 (11:04 +0200)
Flags used to set the execution context of a lua txn are used as an enum. It is
not uncommon but there are few flags otherwise. So to remove ambiguities, a
comment and a _NONE value are added to have a clear definition of supported
values.

This patch should fix the issue #1429. No backport needed.

include/haproxy/hlua-t.h

index 3d33834c7678b3c5eb8b031c6fc7ee5a94bda71f..e4853d34795d334ebaa16900a2c1b69b2a38ec30 100644 (file)
@@ -65,8 +65,15 @@ struct stream;
 #define HLUA_F_AS_STRING    0x01
 #define HLUA_F_MAY_USE_HTTP 0x02
 
+/* HLUA TXN flags */
 #define HLUA_TXN_NOTERM   0x00000001
 /* 0x00000002 .. 0x00000008 unused */
+
+/* The execution context (enum), bits values from 0x00000010 to
+ * 0x00000030. These flags are mutually exclusives. Only one must be set at a
+ * time.
+ */
+#define HLUA_TXN_SMP_NONE 0x00000000 /* No specific execution context */
 #define HLUA_TXN_SMP_CTX  0x00000010 /* Executed from a sample fecth context */
 #define HLUA_TXN_ACT_CTX  0x00000020 /* Executed from a action context */
 #define HLUA_TXN_FLT_CTX  0x00000030 /* Executed from a filter context */