diff src/http/ngx_http_request.c @ 214:e0c502f15852

nginx-0.0.1-2003-12-22-12:40:48 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 22 Dec 2003 09:40:48 +0000
parents f536f91e8e99
children 5adc2b75f8a5
line wrap: on
line diff
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -657,6 +657,24 @@ static void ngx_http_process_request_hea
 
             /* 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_req
         return;
     }
 
-    if (error) {
+    if (error && r->headers_out.status == 0) {
         r->headers_out.status = error;
     }