MINOR: lua: add AppletTCP class and service
This class is used by Lua code for running as an applet called in TCP mode.
It defines also the lua service.
diff --git a/include/types/applet.h b/include/types/applet.h
index 21978bf..2254b0a 100644
--- a/include/types/applet.h
+++ b/include/types/applet.h
@@ -116,6 +116,11 @@
struct list wake_on_write;
} hlua;
struct {
+ struct hlua hlua;
+ int flags;
+ struct task *task;
+ } hlua_apptcp;
+ struct {
struct dns_resolvers *ptr;
} resolvers;
struct {
diff --git a/include/types/hlua.h b/include/types/hlua.h
index 1bf2a75..eccfc6c 100644
--- a/include/types/hlua.h
+++ b/include/types/hlua.h
@@ -17,6 +17,7 @@
#define CLASS_CHANNEL "Channel"
#define CLASS_HTTP "HTTP"
#define CLASS_MAP "Map"
+#define CLASS_APPLET_TCP "AppletTCP"
struct stream;
@@ -98,6 +99,13 @@
struct proxy *p;
};
+/* This struct contains the applet context. */
+struct hlua_appctx {
+ struct appctx *appctx;
+ luaL_Buffer b; /* buffer used to prepare strings. */
+ struct hlua_txn htxn;
+};
+
/* This struc is used with sample fetches and sample converters. */
struct hlua_smp {
struct stream *s;