Skip to content

Commit a9e8565

Browse files
authored
synchronized to meta-lua-nginx-module #ce4a59a and fixed failing tests.
1 parent d475734 commit a9e8565

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1420
-1672
lines changed

src/api/ngx_stream_lua_api.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616

17-
1817
#include <lua.h>
1918
#include <stdint.h>
2019

@@ -41,16 +40,16 @@ lua_State *ngx_stream_lua_get_global_state(ngx_conf_t *cf);
4140

4241
ngx_stream_lua_request_t *ngx_stream_lua_get_request(lua_State *L);
4342

44-
ngx_int_t ngx_stream_lua_add_package_preload(ngx_conf_t *cf, const char *package,
45-
lua_CFunction func);
43+
ngx_int_t ngx_stream_lua_add_package_preload(ngx_conf_t *cf,
44+
const char *package, lua_CFunction func);
4645

4746
ngx_int_t ngx_stream_lua_shared_dict_get(ngx_shm_zone_t *shm_zone,
4847
u_char *key_data, size_t key_len, ngx_stream_lua_value_t *value);
4948

5049
ngx_shm_zone_t *ngx_stream_lua_find_zone(u_char *name_data, size_t name_len);
5150

52-
ngx_shm_zone_t *ngx_stream_lua_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name,
53-
size_t size, void *tag);
51+
ngx_shm_zone_t *ngx_stream_lua_shared_memory_add(ngx_conf_t *cf,
52+
ngx_str_t *name, size_t size, void *tag);
5453

5554

5655
#endif /* _NGX_STREAM_LUA_API_H_INCLUDED_ */

src/ddebug.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
# if (NGX_HAVE_VARIADIC_MACROS)
1919

20-
# define dd(...) fprintf(stderr, "lua *** %s: ", __func__); \
21-
fprintf(stderr, __VA_ARGS__); \
20+
# define dd(...) fprintf(stderr, "lua *** %s: ", __func__); \
21+
fprintf(stderr, __VA_ARGS__); \
2222
fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__)
2323

2424
# else
@@ -54,22 +54,22 @@ dd(const char *fmt, ...) {
5454

5555
#if defined(DDEBUG) && (DDEBUG)
5656

57-
#define dd_check_read_event_handler(r) \
58-
dd("r->read_event_handler = %s", \
59-
r->read_event_handler == ngx_http_block_reading ? \
60-
"ngx_http_block_reading" : \
61-
r->read_event_handler == ngx_http_test_reading ? \
62-
"ngx_http_test_reading" : \
63-
r->read_event_handler == ngx_http_request_empty_handler ? \
57+
#define dd_check_read_event_handler(r) \
58+
dd("r->read_event_handler = %s", \
59+
r->read_event_handler == ngx_http_block_reading ? \
60+
"ngx_http_block_reading" : \
61+
r->read_event_handler == ngx_http_test_reading ? \
62+
"ngx_http_test_reading" : \
63+
r->read_event_handler == ngx_http_request_empty_handler ? \
6464
"ngx_http_request_empty_handler" : "UNKNOWN")
6565

66-
#define dd_check_write_event_handler(r) \
67-
dd("r->write_event_handler = %s", \
68-
r->write_event_handler == ngx_http_handler ? \
69-
"ngx_http_handler" : \
70-
r->write_event_handler == ngx_http_core_run_phases ? \
71-
"ngx_http_core_run_phases" : \
72-
r->write_event_handler == ngx_http_request_empty_handler ? \
66+
#define dd_check_write_event_handler(r) \
67+
dd("r->write_event_handler = %s", \
68+
r->write_event_handler == ngx_http_handler ? \
69+
"ngx_http_handler" : \
70+
r->write_event_handler == ngx_http_core_run_phases ? \
71+
"ngx_http_core_run_phases" : \
72+
r->write_event_handler == ngx_http_request_empty_handler ? \
7373
"ngx_http_request_empty_handler" : "UNKNOWN")
7474

7575
#else

src/ngx_stream_lua_api.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
lua_State *
2020
ngx_stream_lua_get_global_state(ngx_conf_t *cf)
2121
{
22-
ngx_stream_lua_main_conf_t *lmcf;
22+
ngx_stream_lua_main_conf_t *lmcf;
2323

2424
lmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_lua_module);
2525

@@ -42,9 +42,10 @@ ngx_int_t
4242
ngx_stream_lua_add_package_preload(ngx_conf_t *cf, const char *package,
4343
lua_CFunction func)
4444
{
45-
lua_State *L;
46-
ngx_stream_lua_main_conf_t *lmcf;
47-
ngx_stream_lua_preload_hook_t *hook;
45+
lua_State *L;
46+
47+
ngx_stream_lua_main_conf_t *lmcf;
48+
ngx_stream_lua_preload_hook_t *hook;
4849

4950
lmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_lua_module);
5051

@@ -87,10 +88,11 @@ ngx_shm_zone_t *
8788
ngx_stream_lua_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size,
8889
void *tag)
8990
{
90-
ngx_stream_lua_main_conf_t *lmcf;
91+
ngx_stream_lua_main_conf_t *lmcf;
92+
ngx_stream_lua_shm_zone_ctx_t *ctx;
93+
9194
ngx_shm_zone_t **zp;
9295
ngx_shm_zone_t *zone;
93-
ngx_stream_lua_shm_zone_ctx_t *ctx;
9496
ngx_int_t n;
9597

9698
lmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_lua_module);
@@ -155,14 +157,14 @@ ngx_stream_lua_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size,
155157
static ngx_int_t
156158
ngx_stream_lua_shared_memory_init(ngx_shm_zone_t *shm_zone, void *data)
157159
{
158-
ngx_stream_lua_shm_zone_ctx_t *octx = data;
160+
ngx_stream_lua_shm_zone_ctx_t *octx = data;
161+
ngx_stream_lua_main_conf_t *lmcf;
162+
ngx_stream_lua_shm_zone_ctx_t *ctx;
163+
159164
ngx_shm_zone_t *ozone;
160165
void *odata;
161-
162166
ngx_int_t rc;
163167
volatile ngx_cycle_t *saved_cycle;
164-
ngx_stream_lua_main_conf_t *lmcf;
165-
ngx_stream_lua_shm_zone_ctx_t *ctx;
166168
ngx_shm_zone_t *zone;
167169

168170
ctx = (ngx_stream_lua_shm_zone_ctx_t *) shm_zone->data;

src/ngx_stream_lua_args.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818

1919

20-
2120
int
2221
ngx_stream_lua_parse_args(lua_State *L, u_char *buf, u_char *last, int max)
2322
{
@@ -42,7 +41,7 @@ ngx_stream_lua_parse_args(lua_State *L, u_char *buf, u_char *last, int max)
4241
src = q; dst = q;
4342

4443
ngx_stream_lua_unescape_uri(&dst, &src, p - q,
45-
NGX_UNESCAPE_URI_COMPONENT);
44+
NGX_UNESCAPE_URI_COMPONENT);
4645

4746
dd("pushing key %.*s", (int) (dst - q), q);
4847

@@ -60,7 +59,7 @@ ngx_stream_lua_parse_args(lua_State *L, u_char *buf, u_char *last, int max)
6059
src = q; dst = q;
6160

6261
ngx_stream_lua_unescape_uri(&dst, &src, p - q,
63-
NGX_UNESCAPE_URI_COMPONENT);
62+
NGX_UNESCAPE_URI_COMPONENT);
6463

6564
dd("pushing key or value %.*s", (int) (dst - q), q);
6665

@@ -112,7 +111,7 @@ ngx_stream_lua_parse_args(lua_State *L, u_char *buf, u_char *last, int max)
112111
src = q; dst = q;
113112

114113
ngx_stream_lua_unescape_uri(&dst, &src, p - q,
115-
NGX_UNESCAPE_URI_COMPONENT);
114+
NGX_UNESCAPE_URI_COMPONENT);
116115

117116
dd("pushing key or value %.*s", (int) (dst - q), q);
118117

@@ -149,5 +148,4 @@ ngx_stream_lua_parse_args(lua_State *L, u_char *buf, u_char *last, int max)
149148

150149

151150

152-
153151
/* vi:set ft=c ts=4 sw=4 et fdm=marker: */

src/ngx_stream_lua_args.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414

15-
1615
int ngx_stream_lua_parse_args(lua_State *L, u_char *buf, u_char *last, int max);
1716

1817

0 commit comments

Comments
 (0)