-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(openresty-patches) add closed listener's fd patch
Contains the patch from openresty/lua-nginx-module#1832
- Loading branch information
Murillo Paula
committed
Mar 30, 2021
1 parent
6822286
commit ab46a03
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
openresty-patches/patches/1.19.3.1/ngx_lua-0.10.19_03-closed_listener_fd.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From 99ea68a1353fb00b8b5deffb06272e216d46459c Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?=E7=BD=97=E6=B3=BD=E8=BD=A9?= <[email protected]> | ||
Date: Thu, 3 Dec 2020 08:51:40 +0800 | ||
Subject: [PATCH] bugfix: we closed listener's fd which was closed. (#1832) | ||
|
||
fix #1806 | ||
fix #1830 | ||
--- | ||
ngx_lua-0.10.19/src/ngx_http_lua_pipe.c | 6 ++++-- | ||
1 file changed, 4 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/ngx_lua-0.10.19/src/ngx_http_lua_pipe.c b/ngx_lua-0.10.19/src/ngx_http_lua_pipe.c | ||
index c0be9c9e0..c555d7bc9 100644 | ||
--- a/ngx_lua-0.10.19/src/ngx_http_lua_pipe.c | ||
+++ b/ngx_lua-0.10.19/src/ngx_http_lua_pipe.c | ||
@@ -688,8 +688,10 @@ ngx_http_lua_ffi_pipe_spawn(ngx_http_lua_ffi_pipe_proc_t *proc, | ||
/* close listening socket fd */ | ||
ls = ngx_cycle->listening.elts; | ||
for (i = 0; i < ngx_cycle->listening.nelts; i++) { | ||
- if (ngx_close_socket(ls[i].fd) == -1) { | ||
- ngx_log_error(NGX_LOG_EMERG, ngx_cycle->log, ngx_socket_errno, | ||
+ if (ls[i].fd != (ngx_socket_t) -1 && | ||
+ ngx_close_socket(ls[i].fd) == -1) | ||
+ { | ||
+ ngx_log_error(NGX_LOG_WARN, ngx_cycle->log, ngx_socket_errno, | ||
"lua pipe child " ngx_close_socket_n | ||
" %V failed", &ls[i].addr_text); | ||
} |