100-no_by_lua_block.patch 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. --- a/lua-nginx/src/ngx_http_lua_module.c
  2. +++ b/lua-nginx/src/ngx_http_lua_module.c
  3. @@ -157,14 +157,14 @@ static ngx_command_t ngx_http_lua_cmds[]
  4. NGX_HTTP_LOC_CONF_OFFSET,
  5. offsetof(ngx_http_lua_loc_conf_t, log_socket_errors),
  6. NULL },
  7. -
  8. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  9. { ngx_string("init_by_lua_block"),
  10. NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
  11. ngx_http_lua_init_by_lua_block,
  12. NGX_HTTP_MAIN_CONF_OFFSET,
  13. 0,
  14. (void *) ngx_http_lua_init_by_inline },
  15. -
  16. +#endif
  17. { ngx_string("init_by_lua"),
  18. NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
  19. ngx_http_lua_init_by_lua,
  20. @@ -178,14 +178,14 @@ static ngx_command_t ngx_http_lua_cmds[]
  21. NGX_HTTP_MAIN_CONF_OFFSET,
  22. 0,
  23. (void *) ngx_http_lua_init_by_file },
  24. -
  25. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  26. { ngx_string("init_worker_by_lua_block"),
  27. NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
  28. ngx_http_lua_init_worker_by_lua_block,
  29. NGX_HTTP_MAIN_CONF_OFFSET,
  30. 0,
  31. (void *) ngx_http_lua_init_worker_by_inline },
  32. -
  33. +#endif
  34. { ngx_string("init_worker_by_lua"),
  35. NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
  36. ngx_http_lua_init_worker_by_lua,
  37. @@ -201,6 +201,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  38. (void *) ngx_http_lua_init_worker_by_file },
  39. #if defined(NDK) && NDK
  40. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  41. /* set_by_lua $res { inline Lua code } [$arg1 [$arg2 [...]]] */
  42. { ngx_string("set_by_lua_block"),
  43. NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  44. @@ -209,7 +210,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  45. NGX_HTTP_LOC_CONF_OFFSET,
  46. 0,
  47. (void *) ngx_http_lua_filter_set_by_lua_inline },
  48. -
  49. +#endif
  50. /* set_by_lua $res <inline script> [$arg1 [$arg2 [...]]] */
  51. { ngx_string("set_by_lua"),
  52. NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  53. @@ -237,7 +238,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  54. NGX_HTTP_LOC_CONF_OFFSET,
  55. 0,
  56. (void *) ngx_http_lua_rewrite_handler_inline },
  57. -
  58. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  59. /* rewrite_by_lua_block { <inline script> } */
  60. { ngx_string("rewrite_by_lua_block"),
  61. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  62. @@ -246,7 +247,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  63. NGX_HTTP_LOC_CONF_OFFSET,
  64. 0,
  65. (void *) ngx_http_lua_rewrite_handler_inline },
  66. -
  67. +#endif
  68. /* access_by_lua "<inline script>" */
  69. { ngx_string("access_by_lua"),
  70. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  71. @@ -255,7 +256,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  72. NGX_HTTP_LOC_CONF_OFFSET,
  73. 0,
  74. (void *) ngx_http_lua_access_handler_inline },
  75. -
  76. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  77. /* access_by_lua_block { <inline script> } */
  78. { ngx_string("access_by_lua_block"),
  79. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  80. @@ -264,7 +265,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  81. NGX_HTTP_LOC_CONF_OFFSET,
  82. 0,
  83. (void *) ngx_http_lua_access_handler_inline },
  84. -
  85. +#endif
  86. /* content_by_lua "<inline script>" */
  87. { ngx_string("content_by_lua"),
  88. NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
  89. @@ -272,7 +273,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  90. NGX_HTTP_LOC_CONF_OFFSET,
  91. 0,
  92. (void *) ngx_http_lua_content_handler_inline },
  93. -
  94. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  95. /* content_by_lua_block { <inline script> } */
  96. { ngx_string("content_by_lua_block"),
  97. NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
  98. @@ -280,7 +281,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  99. NGX_HTTP_LOC_CONF_OFFSET,
  100. 0,
  101. (void *) ngx_http_lua_content_handler_inline },
  102. -
  103. +#endif
  104. /* log_by_lua <inline script> */
  105. { ngx_string("log_by_lua"),
  106. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  107. @@ -289,7 +290,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  108. NGX_HTTP_LOC_CONF_OFFSET,
  109. 0,
  110. (void *) ngx_http_lua_log_handler_inline },
  111. -
  112. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  113. /* log_by_lua_block { <inline script> } */
  114. { ngx_string("log_by_lua_block"),
  115. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  116. @@ -298,7 +299,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  117. NGX_HTTP_LOC_CONF_OFFSET,
  118. 0,
  119. (void *) ngx_http_lua_log_handler_inline },
  120. -
  121. +#endif
  122. { ngx_string("rewrite_by_lua_file"),
  123. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  124. |NGX_CONF_TAKE1,
  125. @@ -353,7 +354,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  126. NGX_HTTP_LOC_CONF_OFFSET,
  127. 0,
  128. (void *) ngx_http_lua_header_filter_inline },
  129. -
  130. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  131. /* header_filter_by_lua_block { <inline script> } */
  132. { ngx_string("header_filter_by_lua_block"),
  133. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  134. @@ -362,7 +363,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  135. NGX_HTTP_LOC_CONF_OFFSET,
  136. 0,
  137. (void *) ngx_http_lua_header_filter_inline },
  138. -
  139. +#endif
  140. { ngx_string("header_filter_by_lua_file"),
  141. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  142. |NGX_CONF_TAKE1,
  143. @@ -378,7 +379,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  144. NGX_HTTP_LOC_CONF_OFFSET,
  145. 0,
  146. (void *) ngx_http_lua_body_filter_inline },
  147. -
  148. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  149. /* body_filter_by_lua_block { <inline script> } */
  150. { ngx_string("body_filter_by_lua_block"),
  151. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  152. @@ -387,7 +388,7 @@ static ngx_command_t ngx_http_lua_cmds[]
  153. NGX_HTTP_LOC_CONF_OFFSET,
  154. 0,
  155. (void *) ngx_http_lua_body_filter_inline },
  156. -
  157. +#endif
  158. { ngx_string("body_filter_by_lua_file"),
  159. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
  160. |NGX_CONF_TAKE1,
  161. @@ -395,14 +396,14 @@ static ngx_command_t ngx_http_lua_cmds[]
  162. NGX_HTTP_LOC_CONF_OFFSET,
  163. 0,
  164. (void *) ngx_http_lua_body_filter_file },
  165. -
  166. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  167. { ngx_string("balancer_by_lua_block"),
  168. NGX_HTTP_UPS_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
  169. ngx_http_lua_balancer_by_lua_block,
  170. NGX_HTTP_SRV_CONF_OFFSET,
  171. 0,
  172. (void *) ngx_http_lua_balancer_handler_inline },
  173. -
  174. +#endif
  175. { ngx_string("balancer_by_lua_file"),
  176. NGX_HTTP_UPS_CONF|NGX_CONF_TAKE1,
  177. ngx_http_lua_balancer_by_lua,
  178. @@ -509,14 +510,14 @@ static ngx_command_t ngx_http_lua_cmds[]
  179. NGX_HTTP_LOC_CONF_OFFSET,
  180. offsetof(ngx_http_lua_loc_conf_t, ssl_ciphers),
  181. NULL },
  182. -
  183. +#ifndef NGX_LUA_NO_BY_LUA_BLOCK
  184. { ngx_string("ssl_certificate_by_lua_block"),
  185. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
  186. ngx_http_lua_ssl_cert_by_lua_block,
  187. NGX_HTTP_SRV_CONF_OFFSET,
  188. 0,
  189. (void *) ngx_http_lua_ssl_cert_handler_inline },
  190. -
  191. +#endif
  192. { ngx_string("ssl_certificate_by_lua_file"),
  193. NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
  194. ngx_http_lua_ssl_cert_by_lua,