diff src/http/ngx_http_core_module.c @ 3441:b0fbe6ab9ebe stable-0.7

merge r3309, r3314, r3315, r3380: gzip headers related fixes: *) remove "Content-Encoding: gzip" in 304 response sent by ngx_http_gzip_static_module *) refactor gzip_vary handling *) test r->header_only last, since it's not actually frequent here: 304 and HEAD responses are not set it before the filter
author Igor Sysoev <igor@sysoev.ru>
date Mon, 01 Feb 2010 15:54:02 +0000
parents 9ecd253fcc90
children 5d9ff79eab6f
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -773,7 +773,11 @@ ngx_http_handler(ngx_http_request_t *r)
     }
 
     r->valid_location = 1;
-    r->gzip = 0;
+#if (NGX_HTTP_GZIP)
+    r->gzip_tested = 0;
+    r->gzip_ok = 0;
+    r->gzip_vary = 0;
+#endif
 
     r->write_event_handler = ngx_http_core_run_phases;
     ngx_http_core_run_phases(r);
@@ -1860,15 +1864,7 @@ ngx_http_gzip_ok(ngx_http_request_t *r)
     ngx_table_elt_t           *e, *d;
     ngx_http_core_loc_conf_t  *clcf;
 
-    if (r->gzip == 1) {
-        return NGX_OK;
-    }
-
-    if (r->gzip == 2) {
-        return NGX_DECLINED;
-    }
-
-    r->gzip = 2;
+    r->gzip_tested = 1;
 
     if (r != r->main
         || r->headers_in.accept_encoding == NULL
@@ -2003,7 +1999,7 @@ ok:
 
 #endif
 
-    r->gzip = 1;
+    r->gzip_ok = 1;
 
     return NGX_OK;
 }