@@ -10,7 +10,6 @@ local base = require "resty.core.base"
1010local ffi_cast = ffi .cast
1111local table_new = require " table.new"
1212local ffi_str = ffi .string
13- local cycle = getfenv (0 ).__ngx_cycle
1413
1514
1615local get_string_buf = base .get_string_buf
@@ -21,8 +20,8 @@ local ptr_size = ffi.sizeof(void_ptr_type)
2120
2221
2322ffi .cdef [[
24- int ngx_http_lua_ffi_get_ssl_ctx_count (void * cycle );
25- int ngx_http_lua_ffi_get_ssl_ctx_list (void * cycle , void * *buf );
23+ int ngx_http_lua_ffi_get_ssl_ctx_count (void );
24+ int ngx_http_lua_ffi_get_ssl_ctx_list (void ** buf );
2625int ngx_http_lua_ffi_update_ticket_encryption_key (void * ctx ,
2726 const unsigned char * key , unsigned int nkeys , char ** err );
2827int ngx_http_lua_ffi_update_last_ticket_decryption_key (void * ctx ,
@@ -31,11 +30,11 @@ int ngx_http_lua_ffi_update_last_ticket_decryption_key(void *ctx,
3130
3231
3332local function get_ssl_ctx_list ()
34- local n = C .ngx_http_lua_ffi_get_ssl_ctx_count (cycle )
33+ local n = C .ngx_http_lua_ffi_get_ssl_ctx_count ()
3534 local sz = ptr_size * n
3635 local raw_buf = get_string_buf (sz )
3736 local buf = ffi_cast (void_ptr_ptr_type , raw_buf )
38- local rc = C .ngx_http_lua_ffi_get_ssl_ctx_list (cycle , buf )
37+ local rc = C .ngx_http_lua_ffi_get_ssl_ctx_list (buf )
3938 if rc == 0 then -- NGX_OK
4039 local ret = table_new (n , 0 )
4140 for i = 1 , n do
0 commit comments