diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-01-20 10:37:58 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-01-20 10:37:58 +0000 |
commit | 26cf2c96ea50f86c273411a2a4a1514f63800884 (patch) | |
tree | f0de470698e9ff7c9392ad816434c164d9c00bb0 /src/http/ngx_http_request.c | |
parent | 6586e821082d291c45068b208fad6ed360d95b44 (diff) | |
download | nginx-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.c | 9 |
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; } } |