Skip to content

chore: ngx_meta_lua alignment and inherited fixes #1570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/ddebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

# if (NGX_HAVE_VARIADIC_MACROS)

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

# else
Expand Down Expand Up @@ -54,22 +54,22 @@ dd(const char *fmt, ...) {

#if defined(DDEBUG) && (DDEBUG)

#define dd_check_read_event_handler(r) \
dd("r->read_event_handler = %s", \
r->read_event_handler == ngx_http_block_reading ? \
"ngx_http_block_reading" : \
r->read_event_handler == ngx_http_test_reading ? \
"ngx_http_test_reading" : \
r->read_event_handler == ngx_http_request_empty_handler ? \
#define dd_check_read_event_handler(r) \
dd("r->read_event_handler = %s", \
r->read_event_handler == ngx_http_block_reading ? \
"ngx_http_block_reading" : \
r->read_event_handler == ngx_http_test_reading ? \
"ngx_http_test_reading" : \
r->read_event_handler == ngx_http_request_empty_handler ? \
"ngx_http_request_empty_handler" : "UNKNOWN")

#define dd_check_write_event_handler(r) \
dd("r->write_event_handler = %s", \
r->write_event_handler == ngx_http_handler ? \
"ngx_http_handler" : \
r->write_event_handler == ngx_http_core_run_phases ? \
"ngx_http_core_run_phases" : \
r->write_event_handler == ngx_http_request_empty_handler ? \
#define dd_check_write_event_handler(r) \
dd("r->write_event_handler = %s", \
r->write_event_handler == ngx_http_handler ? \
"ngx_http_handler" : \
r->write_event_handler == ngx_http_core_run_phases ? \
"ngx_http_core_run_phases" : \
r->write_event_handler == ngx_http_request_empty_handler ? \
"ngx_http_request_empty_handler" : "UNKNOWN")

#else
Expand Down
12 changes: 6 additions & 6 deletions src/ngx_http_lua_clfactory.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ ngx_http_lua_clfactory_bytecode_prepare(lua_State *L,

#if defined(DDEBUG) && (DDEBUG)
{
dd("==LJ_BT_HEADER==");
size_t i;
for (i = 0; i < LJ_HEADERSIZE; i++) {
dd("%ld: 0x%02X", i, (unsigned)(u_char) lf->begin_code.str[i]);
}
dd("==LJ_BT_HEADER_END==");
dd("==LJ_BT_HEADER==");
size_t i;
for (i = 0; i < LJ_HEADERSIZE; i++) {
dd("%ld: 0x%02X", i, (unsigned)(u_char) lf->begin_code.str[i]);
}
dd("==LJ_BT_HEADER_END==");
}
#endif

Expand Down
1 change: 0 additions & 1 deletion src/ngx_http_lua_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ typedef struct {
ngx_str_t name;
ngx_uint_t offset;
ngx_http_lua_set_header_pt handler;

} ngx_http_lua_set_header_t;


Expand Down
3 changes: 3 additions & 0 deletions src/ngx_http_lua_log_ringbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,6 @@ ngx_http_lua_log_ringbuf_read(ngx_http_lua_log_ringbuf_t *rb, int *log_level,

return NGX_OK;
}


/* vi:set ft=c ts=4 sw=4 et fdm=marker: */
1 change: 0 additions & 1 deletion src/ngx_http_lua_logby.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
ngx_int_t ngx_http_lua_log_handler(ngx_http_request_t *r);
ngx_int_t ngx_http_lua_log_handler_inline(ngx_http_request_t *r);
ngx_int_t ngx_http_lua_log_handler_file(ngx_http_request_t *r);
void ngx_http_lua_inject_logby_ngx_api(ngx_conf_t *cf, lua_State *L);


#endif /* _NGX_HTTP_LUA_LOGBY_H_INCLUDED_ */
Expand Down
6 changes: 3 additions & 3 deletions src/ngx_http_lua_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ ngx_http_lua_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
#ifdef LIBRESSL_VERSION_NUMBER

ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
"LibreSSL does not support ssl_certificate_by_lua*");
"LibreSSL is not supported by ssl_certificate_by_lua*");
return NGX_CONF_ERROR;

#else
Expand Down Expand Up @@ -1060,7 +1060,7 @@ ngx_http_lua_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
if (sscf && sscf->ssl.ctx) {
#ifdef LIBRESSL_VERSION_NUMBER
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
"LibreSSL does not support "
"LibreSSL is not supported by "
"ssl_session_store_by_lua*");

return NGX_CONF_ERROR;
Expand All @@ -1083,7 +1083,7 @@ ngx_http_lua_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
if (sscf && sscf->ssl.ctx) {
#ifdef LIBRESSL_VERSION_NUMBER
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
"LibreSSL does not support "
"LibreSSL is not supported by "
"ssl_session_fetch_by_lua*");

return NGX_CONF_ERROR;
Expand Down
3 changes: 2 additions & 1 deletion src/ngx_http_lua_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,8 @@ ngx_http_lua_ffi_pipe_proc_destroy(ngx_http_lua_ffi_pipe_proc_t *proc)
if (kill(proc->_pid, SIGKILL) == -1) {
if (ngx_errno != ESRCH) {
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_errno,
"lua pipe failed to kill process:%p pid:%P");
"lua pipe failed to kill process:%p pid:%P",
proc, proc->_pid);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ngx_http_lua_regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ ngx_http_lua_regex_compile(ngx_http_lua_regex_compile_t *rc)
if ((size_t) erroff == rc->pattern.len) {
rc->err.len = ngx_snprintf(rc->err.data, rc->err.len,
"pcre_compile() failed: %s in \"%V\"",
errstr, &rc->pattern)
errstr, &rc->pattern)
- rc->err.data;

} else {
Expand Down
2 changes: 1 addition & 1 deletion src/ngx_http_lua_shdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static int ngx_http_lua_shdict_llen(lua_State *L);


static ngx_inline ngx_shm_zone_t *ngx_http_lua_shdict_get_zone(lua_State *L,
int index);
int index);


#define NGX_HTTP_LUA_SHDICT_ADD 0x0001
Expand Down
10 changes: 6 additions & 4 deletions src/ngx_http_lua_socket_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ ngx_http_lua_inject_socket_tcp_api(ngx_log_t *log, lua_State *L)
/* {{{tcp object metatable */
lua_pushlightuserdata(L, ngx_http_lua_lightudata_mask(
tcp_socket_metatable_key));
lua_createtable(L, 0 /* narr */, 12 /* nrec */);
lua_createtable(L, 0 /* narr */, 13 /* nrec */);

lua_pushcfunction(L, ngx_http_lua_socket_tcp_connect);
lua_setfield(L, -2, "connect");
Expand Down Expand Up @@ -4012,9 +4012,11 @@ ngx_http_lua_socket_tcp_conn_op_ctx_cleanup(void *data)
ngx_http_lua_socket_tcp_conn_op_ctx_t *conn_op_ctx = data;

u = conn_op_ctx->u;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, u->request->connection->log, 0,
"cleanup lua tcp socket conn_op_ctx: \"%V\"",
&u->request->uri);

ngx_log_debug3(NGX_LOG_DEBUG_HTTP, u->request->connection->log, 0,
"cleanup lua tcp socket conn_op_ctx: %p, u: %p, "
"request: \"%V\"",
conn_op_ctx, u, &u->request->uri);

ngx_queue_insert_head(&u->socket_pool->cache_connect_op,
&conn_op_ctx->queue);
Expand Down
8 changes: 4 additions & 4 deletions src/ngx_http_lua_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2588,9 +2588,9 @@ ngx_http_lua_process_args_option(ngx_http_request_t *r, lua_State *L,
if (lua_isboolean(L, -1)) {
if (lua_toboolean(L, -1)) {
if (total_escape) {
p = (u_char *) ngx_http_lua_escape_uri(p, key,
key_len,
NGX_ESCAPE_URI_COMPONENT);
p = (u_char *)
ngx_http_lua_escape_uri(p, key, key_len,
NGX_ESCAPE_URI_COMPONENT);

} else {
dd("shortcut: no escape required");
Expand Down Expand Up @@ -3371,7 +3371,7 @@ ngx_http_lua_check_broken_connection(ngx_http_request_t *r, ngx_event_t *ev)
char buf[1];
ngx_err_t err;
ngx_int_t event;
ngx_connection_t *c;
ngx_connection_t *c;

ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ev->log, 0,
"http lua check client, write event:%d, \"%V\"",
Expand Down