Mercurial > hg > nginx-vendor-0-7
diff src/http/modules/ngx_http_gzip_filter_module.c @ 382:984bb0b1399b NGINX_0_7_3
nginx 0.7.3
*) Change: the "rss" extension MIME type has been changed to
"application/rss+xml".
*) Change: now the "gzip_vary" directive turned on issues a
"Vary: Accept-Encoding" header line for uncompressed responses too.
*) Feature: now the "rewrite" directive does a redirect automatically
if the "https://" protocol is used.
*) Bugfix: the "proxy_pass" directive did not work with the HTTPS
protocol; the bug had appeared in 0.6.9.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 23 Jun 2008 00:00:00 +0400 |
parents | 9121a0a91f47 |
children | 05981f639d21 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_gzip_filter_module.c +++ b/src/http/modules/ngx_http_gzip_filter_module.c @@ -204,12 +204,11 @@ static ngx_http_output_body_filter_pt static ngx_int_t ngx_http_gzip_header_filter(ngx_http_request_t *r) { - ngx_str_t *type; - ngx_uint_t i; - ngx_table_elt_t *h; - ngx_http_gzip_ctx_t *ctx; - ngx_http_gzip_conf_t *conf; - ngx_http_core_loc_conf_t *clcf; + ngx_str_t *type; + ngx_uint_t i; + ngx_table_elt_t *h; + ngx_http_gzip_ctx_t *ctx; + ngx_http_gzip_conf_t *conf; conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module); @@ -264,21 +263,6 @@ found: r->headers_out.content_encoding = h; - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - - if (clcf->gzip_vary) { - h = ngx_list_push(&r->headers_out.headers); - if (h == NULL) { - return NGX_ERROR; - } - - h->hash = 1; - h->key.len = sizeof("Vary") - 1; - h->key.data = (u_char *) "Vary"; - h->value.len = sizeof("Accept-Encoding") - 1; - h->value.data = (u_char *) "Accept-Encoding"; - } - ctx->length = r->headers_out.content_length_n; r->main_filter_need_in_memory = 1; @@ -802,7 +786,7 @@ ngx_http_gzip_ratio_variable(ngx_http_re return NGX_OK; } - v->data = ngx_palloc(r->pool, NGX_INT32_LEN + 3); + v->data = ngx_pnalloc(r->pool, NGX_INT32_LEN + 3); if (v->data == NULL) { return NGX_ERROR; } @@ -951,7 +935,7 @@ ngx_http_gzip_types(ngx_conf_t *cf, ngx_ type->len = value[i].len; - type->data = ngx_palloc(cf->pool, type->len + 1); + type->data = ngx_pnalloc(cf->pool, type->len + 1); if (type->data == NULL) { return NGX_CONF_ERROR; }