diff src/http/ngx_http_request.c @ 60:df7d3fff122b NGINX_0_1_30

nginx 0.1.30 *) Bugfix: the worker process may got caught in an endless loop if the SSI was used. *) Bugfix: the response encrypted by SSL may not transferred complete. *) Bugfix: if the length of the response part received at once from proxied or FastCGI server was equal to 500, then nginx returns the 500 response code; in proxy mode the bug appeared in 0.1.29 only. *) Bugfix: nginx did not consider the directives with 8 or 9 parameters as invalid. *) Feature: the "return" directive can return the 204 response code. *) Feature: the "ignore_invalid_headers" directive.
author Igor Sysoev <http://sysoev.ru>
date Sat, 14 May 2005 00:00:00 +0400
parents b55cbf18157e
children 0790a8599248
line wrap: on
line diff
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -725,6 +725,7 @@ ngx_http_process_request_headers(ngx_eve
     ngx_connection_t           *c;
     ngx_http_header_t          *hh;
     ngx_http_request_t         *r;
+    ngx_http_core_srv_conf_t   *cscf;
     ngx_http_core_main_conf_t  *cmcf;
 
     c = rev->data;
@@ -742,6 +743,7 @@ ngx_http_process_request_headers(ngx_eve
     }
 
     cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
+    cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
     hh = (ngx_http_header_t *) cmcf->headers_in_hash.buckets;
 
     rc = NGX_AGAIN;
@@ -783,8 +785,7 @@ ngx_http_process_request_headers(ngx_eve
 
         if (rc == NGX_OK) {
 
-#if 0
-            if (r->invalid_header) {
+            if (r->invalid_header && cscf->ignore_invalid_headers) {
 
                 /* there was error while a header line parsing */
 
@@ -796,7 +797,6 @@ ngx_http_process_request_headers(ngx_eve
                               &header);
                 continue;
             }
-#endif
 
             /* a header line has been parsed successfully */
 
@@ -1406,7 +1406,9 @@ ngx_http_finalize_request(ngx_http_reque
     ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                    "http finalize request: %d, \"%V\"", rc, &r->uri);
 
-    if (r->parent && rc >= NGX_HTTP_SPECIAL_RESPONSE) {
+    if (r->parent
+        && (rc >= NGX_HTTP_SPECIAL_RESPONSE || rc == NGX_HTTP_NO_CONTENT))
+    {
         ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));
         return;
     }
@@ -1450,7 +1452,7 @@ ngx_http_finalize_request(ngx_http_reque
         return;
     }
 
-    if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
+    if (rc >= NGX_HTTP_SPECIAL_RESPONSE || rc == NGX_HTTP_NO_CONTENT) {
 
         if (r->connection->read->timer_set) {
             ngx_del_timer(r->connection->read);