Permalink
Browse files

added debug logging when ngx.req.get_headers() hits header count limit.

  • Loading branch information...
1 parent d40fcc6 commit 11ddbdf9f943984d46e832c39f01d329301b8cc9 @agentzh agentzh committed Jan 4, 2012
Showing with 10 additions and 3 deletions.
  1. +3 −0 src/ngx_http_lua_headers.c
  2. +7 −3 t/028-req-header.t
@@ -79,6 +79,9 @@ ngx_http_lua_ngx_req_get_headers(lua_State *L) {
&header[i].key, &header[i].value);
if (max > 0 && ++count == max) {
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "lua hit request header limit %d", max);
+
return 1;
}
}
View
@@ -10,7 +10,7 @@ use Test::Nginx::Socket;
repeat_each(2);
#repeat_each(1);
-plan tests => (2 * blocks() + 2) * repeat_each();
+plan tests => (2 * blocks() + 4) * repeat_each();
#no_diff();
#no_long_string();
@@ -426,10 +426,12 @@ for my $k (@k) {
}
CORE::join("", @k);
--- timeout: 4
+--- error_log
+lua hit request header limit 100
-=== TEST 20: custom max 102 args
+=== TEST 20: custom max 102 headers
--- config
location /lua {
content_by_lua '
@@ -472,10 +474,12 @@ for my $k (@k) {
}
CORE::join("", @k);
--- timeout: 4
+--- error_log
+lua hit request header limit 102
-=== TEST 21: custom unlimited args
+=== TEST 21: custom unlimited headers
--- config
location /lua {
content_by_lua '

0 comments on commit 11ddbdf

Please sign in to comment.