You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.4 KiB

  1. commit 83a5ff403a2cd625832f01032c0feb8bf9c2a89e
  2. Author: Willy Tarreau <w@1wt.eu>
  3. Date: Wed Aug 21 14:14:50 2019 +0200
  4. MINOR: lua: export applet and task handlers
  5. The current functions are seen outside from the debugging code and are
  6. convenient to export so that we can improve the thread dump output :
  7. void hlua_applet_tcp_fct(struct appctx *ctx);
  8. void hlua_applet_http_fct(struct appctx *ctx);
  9. struct task *hlua_process_task(struct task *task, void *context, unsigned short state);
  10. Of course they are only available when USE_LUA is defined.
  11. (cherry picked from commit 60409db0b1743d670e54244425f6e08c389b7dde)
  12. [wt: backported to improve troubleshooting when the watchdog fires;
  13. while in 2.0 we also have hlua_applet_htx_fct(), it's not
  14. visible outside hlua_applet_http_fct() so we don't care]
  15. Signed-off-by: Willy Tarreau <w@1wt.eu>
  16. diff --git a/include/proto/hlua.h b/include/proto/hlua.h
  17. index 7ad5a99e..32468b77 100644
  18. --- a/include/proto/hlua.h
  19. +++ b/include/proto/hlua.h
  20. @@ -27,6 +27,9 @@
  21. void hlua_ctx_destroy(struct hlua *lua);
  22. void hlua_init();
  23. int hlua_post_init();
  24. +void hlua_applet_tcp_fct(struct appctx *ctx);
  25. +void hlua_applet_http_fct(struct appctx *ctx);
  26. +struct task *hlua_process_task(struct task *task, void *context, unsigned short state);
  27. #else /* USE_LUA */
  28. diff --git a/src/hlua.c b/src/hlua.c
  29. index d2708f87..813aa724 100644
  30. --- a/src/hlua.c
  31. +++ b/src/hlua.c
  32. @@ -6237,7 +6237,7 @@ __LJMP static int hlua_set_nice(lua_State *L)
  33. * Task wrapper are longjmp safe because the only one Lua code
  34. * executed is the safe hlua_ctx_resume();
  35. */
  36. -static struct task *hlua_process_task(struct task *task, void *context, unsigned short state)
  37. +struct task *hlua_process_task(struct task *task, void *context, unsigned short state)
  38. {
  39. struct hlua *hlua = context;
  40. enum hlua_exec status;
  41. @@ -7045,7 +7045,7 @@ static int hlua_applet_tcp_init(struct appctx *ctx, struct proxy *px, struct str
  42. return 1;
  43. }
  44. -static void hlua_applet_tcp_fct(struct appctx *ctx)
  45. +void hlua_applet_tcp_fct(struct appctx *ctx)
  46. {
  47. struct stream_interface *si = ctx->owner;
  48. struct stream *strm = si_strm(si);
  49. @@ -7417,7 +7417,7 @@ static void hlua_applet_htx_fct(struct appctx *ctx)
  50. goto done;
  51. }
  52. -static void hlua_applet_http_fct(struct appctx *ctx)
  53. +void hlua_applet_http_fct(struct appctx *ctx)
  54. {
  55. struct stream_interface *si = ctx->owner;
  56. struct stream *strm = si_strm(si);