Skip to content

Commit 49b83ee

Browse files
committed
fix: warnings and errors
Signed-off-by: if0ne <pavel.agafonov.al@gmail.com>
1 parent 8093d8f commit 49b83ee

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/ngx_http_lua_socket_tcp.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6028,11 +6028,10 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev)
60286028
item = c->data;
60296029

60306030
if (n > 0 && item->on_push_cb_ref != LUA_NOREF) {
6031-
char rbuf[4096];
6032-
ssize_t nread;
6033-
lua_State *L;
6034-
int close_conn;
6035-
int nret;
6031+
unsigned char rbuf[4096];
6032+
ssize_t nread;
6033+
lua_State *L;
6034+
int close_conn;
60366035

60376036
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ev->log, 0,
60386037
"lua tcp socket keepalive: data received, calling cb");
@@ -6052,7 +6051,7 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev)
60526051
}
60536052

60546053
lua_rawgeti(L, LUA_REGISTRYINDEX, item->on_push_cb_ref);
6055-
lua_pushlstring(L, rbuf, (size_t) nread);
6054+
lua_pushlstring(L, (const char *) rbuf, (size_t) nread);
60566055

60576056
/* callback(data) -> reply:string|nil, close:bool */
60586057
if (lua_pcall(L, 1, 2, 0) != LUA_OK) {
@@ -6070,7 +6069,10 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev)
60706069
ssize_t nsent = 0;
60716070

60726071
while ((size_t) nsent < slen) {
6073-
ssize_t w = c->send(c, sdata + nsent, slen - nsent, 0);
6072+
ssize_t w = c->send(c,
6073+
(u_char *) (sdata + nsent),
6074+
slen - nsent);
6075+
60746076
if (w <= 0) {
60756077
lua_pop(L, 2);
60766078
goto close;

0 commit comments

Comments
 (0)