Skip to content

Commit 5095da4

Browse files
doujiang24doujiang24
andauthored
change: do not need to create the Lua request ctx data table from C (#1926)
since we already changed to add the ctx table to the registry table at Lua land in resty.core.ctx. related change: openresty/lua-resty-core@2d667ec Notice: people who use the raw ffi C api to build their own ctx related Lua library(just like resty.core.ctx) need to require resty.core.ctx first. Co-authored-by: doujiang24 <dejiang@openresty.com>
1 parent 5425d6d commit 5095da4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/ngx_http_lua_util.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,13 @@ ngx_http_lua_init_registry(lua_State *L, ngx_log_t *log)
781781
lua_rawset(L, LUA_REGISTRYINDEX);
782782
/* }}} */
783783

784-
/* create the registry entry for the Lua request ctx data table */
785-
lua_pushliteral(L, ngx_http_lua_ctx_tables_key);
786-
lua_createtable(L, 0, 32 /* nrec */);
787-
lua_rawset(L, LUA_REGISTRYINDEX);
784+
/*
785+
* the the Lua request ctx data table will create in resty.core.ctx,
786+
* just equivalent to the following code:
787+
* lua_pushliteral(L, ngx_http_lua_ctx_tables_key);
788+
* lua_createtable(L, 0, 0);
789+
* lua_rawset(L, LUA_REGISTRYINDEX);
790+
*/
788791

789792
/* create the registry entry for the Lua socket connection pool table */
790793
lua_pushlightuserdata(L, ngx_http_lua_lightudata_mask(

0 commit comments

Comments
 (0)