File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,7 @@ ffi.cdef[[
136
136
137
137
uint32_t ngx_http_lua_ffi_max_regex_cache_size (void );
138
138
139
- void ngx_http_lua_ffi_set_jit_stack_size (int size );
140
-
139
+ int ngx_http_lua_set_jit_stack_size (int size );
141
140
]]
142
141
143
142
@@ -165,12 +164,22 @@ local function get_max_regex_cache_size()
165
164
return max_regex_cache_size
166
165
end
167
166
167
+
168
168
function ngx .re .opt (option , value )
169
169
if option == " jit_stack_size" then
170
- C .ngx_http_lua_ffi_set_jit_stack_size (value )
170
+ local result = C .ngx_http_lua_set_jit_stack_size (value )
171
+
172
+ if result ~= 0 then
173
+ return error (" PCRE jit stack allocation failed" )
174
+ end
175
+
176
+ return
171
177
end
178
+
179
+ return error (" unrecognized option name" )
172
180
end
173
181
182
+
174
183
local function parse_regex_opts (opts )
175
184
local t = cached_re_opts [opts ]
176
185
if t then
You can’t perform that action at this time.
0 commit comments