Skip to content

Commit 44fce69

Browse files
committed
bugfix: we closed listener's fd which was closed.
fix openresty#1806 fix openresty#1830
1 parent 7105ada commit 44fce69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ngx_http_lua_pipe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ ngx_http_lua_ffi_pipe_spawn(ngx_http_lua_ffi_pipe_proc_t *proc,
688688
/* close listening socket fd */
689689
ls = ngx_cycle->listening.elts;
690690
for (i = 0; i < ngx_cycle->listening.nelts; i++) {
691-
if (ngx_close_socket(ls[i].fd) == -1) {
691+
if (ls[i].fd != -1 && ngx_close_socket(ls[i].fd) == -1) {
692692
ngx_log_error(NGX_LOG_EMERG, ngx_cycle->log, ngx_socket_errno,
693693
"lua pipe child " ngx_close_socket_n
694694
" %V failed", &ls[i].addr_text);

0 commit comments

Comments
 (0)