nginx-0.1.30-RELEASE import

    *) 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 the bug had 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.
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 28412b6..4cbf915 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -725,6 +725,7 @@
     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 @@
     }
 
     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 @@
 
         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 @@
                               &header);
                 continue;
             }
-#endif
 
             /* a header line has been parsed successfully */
 
@@ -1406,7 +1406,9 @@
     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 @@
         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);