change: made the error messages for regex compilation failures less verbose.

This commit is contained in:
agentzh (Yichun Zhang) 2013-05-07 18:07:41 -07:00
Родитель 4806fc2eef
Коммит 35e6a65f9f
12 изменённых файлов: 20 добавлений и 32 удалений

Просмотреть файл

@ -288,11 +288,7 @@ ngx_http_lua_ngx_re_match(lua_State *L)
dd("compile failed");
lua_pushnil(L);
re_comp.err.data[re_comp.err.len] = '\0';
msg = lua_pushfstring(L, "failed to compile regex \"%s\": %s",
pat.data, re_comp.err.data);
lua_pushlstring(L, (char *) re_comp.err.data, re_comp.err.len);
return 2;
}
@ -711,11 +707,7 @@ ngx_http_lua_ngx_re_gmatch(lua_State *L)
dd("compile failed");
lua_pushnil(L);
re_comp.err.data[re_comp.err.len] = '\0';
msg = lua_pushfstring(L, "failed to compile regex \"%s\": %s",
pat.data, re_comp.err.data);
lua_pushlstring(L, (char *) re_comp.err.data, re_comp.err.len);
return 2;
}
@ -1397,11 +1389,7 @@ ngx_http_lua_ngx_re_sub_helper(lua_State *L, unsigned global)
lua_pushnil(L);
lua_pushnil(L);
re_comp.err.data[re_comp.err.len] = '\0';
msg = lua_pushfstring(L, "failed to compile regex \"%s\": %s",
pat.data, re_comp.err.data);
lua_pushlstring(L, (char *) re_comp.err.data, re_comp.err.len);
return 3;
}

Просмотреть файл

@ -241,7 +241,7 @@ hello
--- request
GET /re
--- response_body_like chop
^(?:FAIL: bad argument \#2 to '\?' \(failed to compile regex "HELLO\.\{2\}": pcre_compile\(\) failed: this version of PCRE is not compiled with PCRE_UTF8 support in "HELLO\.\{2\}" at "HELLO\.\{2\}"\)|hello章亦)$
^(?:FAIL: bad argument \#2 to '\?' \(pcre_compile\(\) failed: this version of PCRE is not compiled with PCRE_UTF8 support in "HELLO\.\{2\}" at "HELLO\.\{2\}"\)|hello章亦)$
@ -362,7 +362,7 @@ he
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]
@ -649,7 +649,7 @@ regex: (?:>[\w\s]*</?\w{2,}>)
--- request
GET /re
--- response_body
error: failed to compile regex "([0-9]+": pcre_compile() failed: missing ) in "([0-9]+"
error: pcre_compile() failed: missing ) in "([0-9]+"
--- no_error_log
[error]

Просмотреть файл

@ -699,7 +699,7 @@ not matched!
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -476,7 +476,7 @@ a [b c] [b] [c] [] [] d
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -338,7 +338,7 @@ he
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -122,7 +122,7 @@ pcre JIT compiling result: 1
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -208,7 +208,7 @@ pcre JIT compiling result: 1
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -213,7 +213,7 @@ hello
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -116,7 +116,7 @@ pcre JIT compiling result: 1
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]
@ -137,7 +137,7 @@ error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -109,7 +109,7 @@ hello, world: 0
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]
@ -131,7 +131,7 @@ error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -116,7 +116,7 @@ pcre JIT compiling result: 1
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]
@ -137,7 +137,7 @@ error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]

Просмотреть файл

@ -109,7 +109,7 @@ hello, world: 0
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
@ -128,7 +128,7 @@ error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc
--- request
GET /re
--- response_body
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]