aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-11-12 13:41:56 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-11-12 13:41:56 +0000
commit6c49a5afcfa76ea5ed1ca5801bf955b102b2b597 (patch)
tree9732376c30ce7baa94fc2cacb3054648d7af3bba /src/http/ngx_http_core_module.c
parent2c0b6f3e70a7a4c277fec04d13845f0895ff2a04 (diff)
downloadnginx-6c49a5afcfa76ea5ed1ca5801bf955b102b2b597.tar.gz
nginx-6c49a5afcfa76ea5ed1ca5801bf955b102b2b597.zip
refactor gzip_vary handling
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 9cce2d547..ee0864c14 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -812,7 +812,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);
@@ -1891,15 +1895,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
@@ -2034,7 +2030,7 @@ ok:
#endif
- r->gzip = 1;
+ r->gzip_ok = 1;
return NGX_OK;
}