Permalink
Browse files

added debug log when ngx.req.get_uri_args and ngx.req.get_post_args h…

…it max args limit.
  • Loading branch information...
1 parent 8e8517c commit d40fcc6690fc867a2f7517de281e9b6f1d053578 @agentzh agentzh committed Jan 4, 2012
Showing with 24 additions and 4 deletions.
  1. +2 −2 src/ngx_http_lua_args.c
  2. +11 −1 t/030-uri-args.t
  3. +11 −1 t/031-post-args.t
@@ -291,8 +291,8 @@ ngx_http_lua_parse_args(ngx_http_request_t *r, lua_State *L, u_char *buf,
}
if (max > 0 && ++count == max) {
- dd("gettop: %d", lua_gettop(L));
- dd("type: %s", lua_typename(L, lua_type(L, 1)));
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "lua hit query args limit %d", max);
return 1;
}
View
@@ -10,7 +10,7 @@ use Test::Nginx::Socket;
repeat_each(2);
#repeat_each(1);
-plan tests => repeat_each() * (blocks() * 2);
+plan tests => repeat_each() * (blocks() * 2 + 5);
no_root_location();
@@ -786,6 +786,8 @@ GET /lua?foo=3&bar=4&baz=2
--- response_body
bar = 4
foo = 3
+--- error_log
+lua hit query args limit 2
@@ -810,6 +812,8 @@ GET /lua?foo=3&bar&baz=2
--- response_body
bar = true
foo = 3
+--- error_log
+lua hit query args limit 2
@@ -836,6 +840,8 @@ GET /lua?foo=3&=hello&=world
--- response_body
foo = 3
done
+--- error_log
+lua hit query args limit 2
@@ -881,6 +887,8 @@ for my $k (@k) {
}
CORE::join("", @k);
--- timeout: 4
+--- error_log
+lua hit query args limit 100
@@ -926,6 +934,8 @@ for my $k (@k) {
}
CORE::join("", @k);
--- timeout: 4
+--- error_log
+lua hit query args limit 102
View
@@ -10,7 +10,7 @@ use Test::Nginx::Socket;
repeat_each(2);
#repeat_each(1);
-plan tests => repeat_each() * (blocks() * 2);
+plan tests => repeat_each() * (blocks() * 2 + 5);
#no_diff();
#no_long_string();
@@ -121,6 +121,8 @@ foo=3&bar=4&baz=2
--- response_body
bar = 4
foo = 3
+--- error_log
+lua hit query args limit 2
@@ -147,6 +149,8 @@ foo=3&bar&baz=2
--- response_body
bar = true
foo = 3
+--- error_log
+lua hit query args limit 2
@@ -175,6 +179,8 @@ foo=3&=hello&=world
--- response_body
foo = 3
done
+--- error_log
+lua hit query args limit 2
@@ -221,6 +227,8 @@ for my $k (@k) {
}
CORE::join("", @k);
--- timeout: 4
+--- error_log
+lua hit query args limit 100
@@ -267,6 +275,8 @@ for my $k (@k) {
}
CORE::join("", @k);
--- timeout: 4
+--- error_log
+lua hit query args limit 102

0 comments on commit d40fcc6

Please sign in to comment.