openresty / stream-lua-nginx-module

Embed the power of Lua into NGINX TCP/UDP servers
BSD 2-Clause "Simplified" License
725 stars 199 forks source link

bugfix: we should ignore match limit in DFA mode. #262

Closed balusch closed 3 years ago

balusch commented 3 years ago

lua_regex_match_limit takes effect globally for all regexes used in ngx.re api. However, the match_limit field of pcre_extra block is not supported in pcre_dfa_exec()(so does match_limit_recursion), because it is meaningless in DFA matching. And pcre_dfa_exec() will return -18(PCRE_ERROR_DFA_UMLIMIT) when the directive is used. Here we just ignore the directive in DFA mode.