aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-12-22 09:40:48 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-12-22 09:40:48 +0000
commit669e3319cea6431bd4605a41979389789b2e046d (patch)
treee085369c185439a82e9a666beb947763666c7da1 /src/http/ngx_http_request.c
parent1cd1e2741ab83cd7e0816e8b8ff43b3668703ea6 (diff)
downloadnginx-669e3319cea6431bd4605a41979389789b2e046d.tar.gz
nginx-669e3319cea6431bd4605a41979389789b2e046d.zip
nginx-0.0.1-2003-12-22-12:40:48 import
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 396e282c0..9408fc8e3 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -657,6 +657,24 @@ static void ngx_http_process_request_headers(ngx_event_t *rev)
/* there was error while a header line parsing */
+#if (NGX_LOG_DEBUG)
+ if (rc == NGX_HTTP_PARSE_INVALID_HEADER) {
+ char *p;
+ for (p = r->header_name_start;
+ p < r->header_in->last - 1;
+ p++)
+ {
+ if (*p == CR || *p == LF) {
+ break;
+ }
+ }
+ *p = '\0';
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, rev->log, 0,
+ "http invalid header: \"%s\"",
+ r->header_name_start);
+ }
+#endif
+
ngx_http_client_error(r, rc, NGX_HTTP_BAD_REQUEST);
return;
}
@@ -1419,7 +1437,7 @@ void ngx_http_close_request(ngx_http_request_t *r, int error)
return;
}
- if (error) {
+ if (error && r->headers_out.status == 0) {
r->headers_out.status = error;
}