aboutsummaryrefslogtreecommitdiff
path: root/net/haproxy/patches/002-MINOR-lua-export-applet-and-task-handlers.patch
blob: 38cc108d64bb0a7ed5aa5ca2db738270847ae996 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
commit 83a5ff403a2cd625832f01032c0feb8bf9c2a89e
Author: Willy Tarreau <w@1wt.eu>
Date:   Wed Aug 21 14:14:50 2019 +0200

    MINOR: lua: export applet and task handlers
    
    The current functions are seen outside from the debugging code and are
    convenient to export so that we can improve the thread dump output :
    
      void hlua_applet_tcp_fct(struct appctx *ctx);
      void hlua_applet_http_fct(struct appctx *ctx);
      struct task *hlua_process_task(struct task *task, void *context, unsigned short state);
    
    Of course they are only available when USE_LUA is defined.
    
    (cherry picked from commit 60409db0b1743d670e54244425f6e08c389b7dde)
    [wt: backported to improve troubleshooting when the watchdog fires;
         while in 2.0 we also have hlua_applet_htx_fct(), it's not
         visible outside hlua_applet_http_fct() so we don't care]
    Signed-off-by: Willy Tarreau <w@1wt.eu>

diff --git a/include/proto/hlua.h b/include/proto/hlua.h
index 7ad5a99e..32468b77 100644
--- a/include/proto/hlua.h
+++ b/include/proto/hlua.h
@@ -27,6 +27,9 @@
 void hlua_ctx_destroy(struct hlua *lua);
 void hlua_init();
 int hlua_post_init();
+void hlua_applet_tcp_fct(struct appctx *ctx);
+void hlua_applet_http_fct(struct appctx *ctx);
+struct task *hlua_process_task(struct task *task, void *context, unsigned short state);
 
 #else /* USE_LUA */
 
diff --git a/src/hlua.c b/src/hlua.c
index d2708f87..813aa724 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -6237,7 +6237,7 @@ __LJMP static int hlua_set_nice(lua_State *L)
  * Task wrapper are longjmp safe because the only one Lua code
  * executed is the safe hlua_ctx_resume();
  */
-static struct task *hlua_process_task(struct task *task, void *context, unsigned short state)
+struct task *hlua_process_task(struct task *task, void *context, unsigned short state)
 {
 	struct hlua *hlua = context;
 	enum hlua_exec status;
@@ -7045,7 +7045,7 @@ static int hlua_applet_tcp_init(struct appctx *ctx, struct proxy *px, struct str
 	return 1;
 }
 
-static void hlua_applet_tcp_fct(struct appctx *ctx)
+void hlua_applet_tcp_fct(struct appctx *ctx)
 {
 	struct stream_interface *si = ctx->owner;
 	struct stream *strm = si_strm(si);
@@ -7417,7 +7417,7 @@ static void hlua_applet_htx_fct(struct appctx *ctx)
 	goto done;
 }
 
-static void hlua_applet_http_fct(struct appctx *ctx)
+void hlua_applet_http_fct(struct appctx *ctx)
 {
 	struct stream_interface *si = ctx->owner;
 	struct stream *strm = si_strm(si);