From e52b136dd7a6ad34b361b8b48eef7cbaa48282ca Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 21 Jan 2011 11:06:03 +0000 Subject: Changes with nginx 0.9.4 21 Jan 2011 *) Feature: the "server_name" directive supports the $hostname variable. *) Feature: 494 code for "Request Header Too Large" error. --- src/http/ngx_http_request.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/http/ngx_http_request.c') 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; } } -- cgit v1.2.1