Skip to content

Commit 7b2c4ce

Browse files
committed
feat: enable cosockets in init_worker_by_lua
Signed-off-by: Nic <[email protected]>
1 parent b94ebab commit 7b2c4ce

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git lib/resty/core/coroutine.lua lib/resty/core/coroutine.lua
2+
index 9c95b16..57cd4c7 100644
3+
--- lib/resty/core/coroutine.lua
4+
+++ lib/resty/core/coroutine.lua
5+
@@ -13,7 +13,7 @@ do
6+
local r = get_request()
7+
if r ~= nil then
8+
local ctx = get_raw_phase(r, errmsg)
9+
- if ctx ~= 0x020 and ctx ~= 0x040 then
10+
+ if ctx ~= 0x020 and ctx ~= 0x040 and ctx ~= 0x100 then
11+
return ours(...)
12+
end
13+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git src/ngx_http_lua_coroutine.c src/ngx_http_lua_coroutine.c
2+
index 1580c5b2..d0bc045c 100644
3+
--- src/ngx_http_lua_coroutine.c
4+
+++ src/ngx_http_lua_coroutine.c
5+
@@ -358,7 +358,7 @@ ngx_http_lua_inject_coroutine_api(ngx_log_t *log, lua_State *L)
6+
"local ctx = raw_ctx(r)\n"
7+
#endif
8+
/* ignore header and body filters */
9+
- "if ctx ~= 0x020 and ctx ~= 0x040 then\n"
10+
+ "if ctx ~= 0x020 and ctx ~= 0x040 and ctx ~= 0x100 then\n"
11+
"return ours(...)\n"
12+
"end\n"
13+
"end\n"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git lib/resty/core/coroutine.lua lib/resty/core/coroutine.lua
2+
index 9c95b16..57cd4c7 100644
3+
--- lib/resty/core/coroutine.lua
4+
+++ lib/resty/core/coroutine.lua
5+
@@ -13,7 +13,7 @@ do
6+
local r = get_request()
7+
if r ~= nil then
8+
local ctx = get_raw_phase(r, errmsg)
9+
- if ctx ~= 0x020 and ctx ~= 0x040 then
10+
+ if ctx ~= 0x020 and ctx ~= 0x040 and ctx ~= 0x100 then
11+
return ours(...)
12+
end
13+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git src/ngx_http_lua_coroutine.c src/ngx_http_lua_coroutine.c
2+
index 1580c5b2..d0bc045c 100644
3+
--- src/ngx_http_lua_coroutine.c
4+
+++ src/ngx_http_lua_coroutine.c
5+
@@ -358,7 +358,7 @@ ngx_http_lua_inject_coroutine_api(ngx_log_t *log, lua_State *L)
6+
"local ctx = raw_ctx(r)\n"
7+
#endif
8+
/* ignore header and body filters */
9+
- "if ctx ~= 0x020 and ctx ~= 0x040 then\n"
10+
+ "if ctx ~= 0x020 and ctx ~= 0x040 and ctx ~= 0x100 then\n"
11+
"return ours(...)\n"
12+
"end\n"
13+
"end\n"

0 commit comments

Comments
 (0)