nginx-0.3.31-RELEASE import

    *) Change: now nginx passes the malformed proxied backend responses.

    *) Feature: the "listen" directives support the address in the "*:port"
       form.

    *) Feature: the EVFILER_TIMER support in MacOSX 10.4.

    *) Workaround: for MacOSX 64-bit kernel kqueue millisecond timeout
       bug.
       Thanks to Andrei Nigmatulin.

    *) Bugfix: if there were several "listen" directives listening one
       various addresses inside one server, then server names like
       "*.domain.tld" worked for first address only; the bug had appeared
       in 0.3.18.

    *) Bugfix: if the HTTPS protocol was used in the "proxy_pass" directive
       and the request body was in temporarily file then the request was
       not transferred.

    *) Bugfix: perl 5.8.8 compatibility.
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index e66b48b..34e6dd1 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -800,9 +800,11 @@
         ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
                       "upstream sent no valid HTTP/1.0 header");
 
+#if 0
         if (u->accel) {
             return NGX_HTTP_UPSTREAM_INVALID_HEADER;
         }
+#endif
 
         r->http_version = NGX_HTTP_VERSION_9;
         p->status = NGX_HTTP_OK;
@@ -961,6 +963,10 @@
 
         /* HTTP status code */
         case sw_status:
+            if (ch == ' ') {
+                break;
+            }
+
             if (ch < '0' || ch > '9') {
                 return NGX_HTTP_PROXY_PARSE_NO_HEADER;
             }
@@ -1111,8 +1117,7 @@
         /* there was error while a header line parsing */
 
         ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
-                      ngx_http_upstream_header_errors[rc
-                                               - NGX_HTTP_PARSE_HEADER_ERROR]);
+                      "upstream sent invalid header");
 
         return NGX_HTTP_UPSTREAM_INVALID_HEADER;
     }