aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-01-20 10:37:58 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-01-20 10:37:58 +0000
commit26cf2c96ea50f86c273411a2a4a1514f63800884 (patch)
treef0de470698e9ff7c9392ad816434c164d9c00bb0 /src/http/ngx_http_request.c
parent6586e821082d291c45068b208fad6ed360d95b44 (diff)
downloadnginx-26cf2c96ea50f86c273411a2a4a1514f63800884.tar.gz
nginx-26cf2c96ea50f86c273411a2a4a1514f63800884.zip
introduce 494 code "Request Header Too Large"
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 55e220a31..bd51e061f 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -978,10 +978,13 @@ ngx_http_process_request_headers(ngx_event_t *rev)
if (rv == NGX_DECLINED) {
p = r->header_name_start;
+ r->lingering_close = 1;
+
if (p == NULL) {
ngx_log_error(NGX_LOG_INFO, c->log, 0,
"client sent too large request");
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
+ ngx_http_finalize_request(r,
+ NGX_HTTP_REQUEST_HEADER_TOO_LARGE);
return;
}
@@ -995,7 +998,9 @@ ngx_http_process_request_headers(ngx_event_t *rev)
ngx_log_error(NGX_LOG_INFO, c->log, 0,
"client sent too long header line: \"%*s\"",
len, r->header_name_start);
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
+
+ ngx_http_finalize_request(r,
+ NGX_HTTP_REQUEST_HEADER_TOO_LARGE);
return;
}
}