This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 68485f3a6 chore(stream): there is no reusable api_ctx (#6933)
68485f3a6 is described below
commit 68485f3a6b6bf7f10bfecce383ef91c3992510c4
Author: 罗泽轩 <[email protected]>
AuthorDate: Tue Apr 26 20:44:28 2022 +0800
chore(stream): there is no reusable api_ctx (#6933)
As the TLS handshake and the stream conn is 1:1, there is no reusable
api_ctx. Better to keep the same as the part of HTTP subsystem.
Signed-off-by: spacewander <[email protected]>
---
apisix/init.lua | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/apisix/init.lua b/apisix/init.lua
index 429d44926..7eebd2de3 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -794,15 +794,9 @@ end
function _M.stream_preread_phase()
- core.log.info("enter stream_preread_phase")
-
local ngx_ctx = ngx.ctx
- local api_ctx = ngx_ctx.api_ctx
-
- if not api_ctx then
- api_ctx = core.tablepool.fetch("api_ctx", 0, 32)
- ngx_ctx.api_ctx = api_ctx
- end
+ local api_ctx = core.tablepool.fetch("api_ctx", 0, 32)
+ ngx_ctx.api_ctx = api_ctx
if not verify_tls_client(api_ctx) then
return ngx_exit(1)