diff src/http/modules/ngx_http_proxy_module.c @ 4125:e5df04b05e75

Protocol version parsing in ngx_http_parse_status_line(). Once we know protocol version, set u->headers_in.connection_close to indicate implicitly assumed connection close with HTTP before 1.1.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 15 Sep 2011 19:22:35 +0000
parents 3183165283cc
children bba9a5ccc6cd
line wrap: on
line diff
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1210,6 +1210,7 @@ ngx_http_proxy_process_status_line(ngx_h
 
         r->http_version = NGX_HTTP_VERSION_9;
         u->state->status = NGX_HTTP_OK;
+        u->headers_in.connection_close = 1;
 
         return NGX_OK;
     }
@@ -1234,6 +1235,10 @@ ngx_http_proxy_process_status_line(ngx_h
                    "http proxy status %ui \"%V\"",
                    u->headers_in.status_n, &u->headers_in.status_line);
 
+    if (ctx->status.http_version < NGX_HTTP_VERSION_11) {
+        u->headers_in.connection_close = 1;
+    }
+
     u->process_header = ngx_http_proxy_process_header;
 
     return ngx_http_proxy_process_header(r);