comparison src/http/modules/ngx_http_gzip_filter_module.c @ 3313:118169a8ec92

refactor gzip_vary handling
author Igor Sysoev <igor@sysoev.ru>
date Thu, 12 Nov 2009 13:41:56 +0000
parents c7d57b539248
children d17c4c5c1c57
comparison
equal deleted inserted replaced
3312:dddca6f42e7b 3313:118169a8ec92
249 || r->header_only 249 || r->header_only
250 || (r->headers_out.content_encoding 250 || (r->headers_out.content_encoding
251 && r->headers_out.content_encoding->value.len) 251 && r->headers_out.content_encoding->value.len)
252 || (r->headers_out.content_length_n != -1 252 || (r->headers_out.content_length_n != -1
253 && r->headers_out.content_length_n < conf->min_length) 253 && r->headers_out.content_length_n < conf->min_length)
254 || ngx_http_test_content_type(r, &conf->types) == NULL 254 || ngx_http_test_content_type(r, &conf->types) == NULL)
255 || ngx_http_gzip_ok(r) != NGX_OK)
256 { 255 {
256 return ngx_http_next_header_filter(r);
257 }
258
259 r->gzip_vary = 1;
260
261 if (!r->gzip_tested) {
262 if (ngx_http_gzip_ok(r) != NGX_OK) {
263 return ngx_http_next_header_filter(r);
264 }
265
266 } else if (!r->gzip_ok) {
257 return ngx_http_next_header_filter(r); 267 return ngx_http_next_header_filter(r);
258 } 268 }
259 269
260 ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_gzip_ctx_t)); 270 ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_gzip_ctx_t));
261 if (ctx == NULL) { 271 if (ctx == NULL) {