Mercurial > hg > nginx-ranges
comparison src/http/modules/ngx_http_gzip_filter_module.c @ 635:e67b227c8dbb default tip
Merge with current.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Apr 2011 04:07:55 +0400 |
parents | c5122335e41d |
children |
comparison
equal
deleted
inserted
replaced
578:f3a9e57d2e17 | 635:e67b227c8dbb |
---|---|
256 return ngx_http_next_header_filter(r); | 256 return ngx_http_next_header_filter(r); |
257 } | 257 } |
258 | 258 |
259 r->gzip_vary = 1; | 259 r->gzip_vary = 1; |
260 | 260 |
261 #if (NGX_HTTP_DEGRADATION) | |
262 { | |
263 ngx_http_core_loc_conf_t *clcf; | |
264 | |
265 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
266 | |
267 if (clcf->gzip_disable_degradation && ngx_http_degraded(r)) { | |
268 return ngx_http_next_header_filter(r); | |
269 } | |
270 } | |
271 #endif | |
272 | |
261 if (!r->gzip_tested) { | 273 if (!r->gzip_tested) { |
262 if (ngx_http_gzip_ok(r) != NGX_OK) { | 274 if (ngx_http_gzip_ok(r) != NGX_OK) { |
263 return ngx_http_next_header_filter(r); | 275 return ngx_http_next_header_filter(r); |
264 } | 276 } |
265 | 277 |
283 if (h == NULL) { | 295 if (h == NULL) { |
284 return NGX_ERROR; | 296 return NGX_ERROR; |
285 } | 297 } |
286 | 298 |
287 h->hash = 1; | 299 h->hash = 1; |
288 h->key.len = sizeof("Content-Encoding") - 1; | 300 ngx_str_set(&h->key, "Content-Encoding"); |
289 h->key.data = (u_char *) "Content-Encoding"; | 301 ngx_str_set(&h->value, "gzip"); |
290 h->value.len = sizeof("gzip") - 1; | |
291 h->value.data = (u_char *) "gzip"; | |
292 | |
293 r->headers_out.content_encoding = h; | 302 r->headers_out.content_encoding = h; |
294 | 303 |
295 r->main_filter_need_in_memory = 1; | 304 r->main_filter_need_in_memory = 1; |
296 | 305 |
297 ngx_http_clear_content_length(r); | 306 ngx_http_clear_content_length(r); |