Mercurial > hg > nginx
comparison src/http/ngx_http_header_filter_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 | 507fc5ac9839 |
children | 616da2ea901f 667c22171519 |
comparison
equal
deleted
inserted
replaced
3440:88741ec7731a | 3441:b0fbe6ab9ebe |
---|---|
397 } else { | 397 } else { |
398 len += sizeof("Connection: closed" CRLF) - 1; | 398 len += sizeof("Connection: closed" CRLF) - 1; |
399 } | 399 } |
400 | 400 |
401 #if (NGX_HTTP_GZIP) | 401 #if (NGX_HTTP_GZIP) |
402 if (r->gzip && clcf->gzip_vary) { | 402 if (r->gzip_vary) { |
403 len += sizeof("Vary: Accept-Encoding" CRLF) - 1; | 403 if (clcf->gzip_vary) { |
404 len += sizeof("Vary: Accept-Encoding" CRLF) - 1; | |
405 | |
406 } else { | |
407 r->gzip_vary = 0; | |
408 } | |
404 } | 409 } |
405 #endif | 410 #endif |
406 | 411 |
407 part = &r->headers_out.headers.part; | 412 part = &r->headers_out.headers.part; |
408 header = part->elts; | 413 header = part->elts; |
557 b->last = ngx_cpymem(b->last, "Connection: close" CRLF, | 562 b->last = ngx_cpymem(b->last, "Connection: close" CRLF, |
558 sizeof("Connection: close" CRLF) - 1); | 563 sizeof("Connection: close" CRLF) - 1); |
559 } | 564 } |
560 | 565 |
561 #if (NGX_HTTP_GZIP) | 566 #if (NGX_HTTP_GZIP) |
562 if (r->gzip && clcf->gzip_vary) { | 567 if (r->gzip_vary) { |
563 b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF, | 568 b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF, |
564 sizeof("Vary: Accept-Encoding" CRLF) - 1); | 569 sizeof("Vary: Accept-Encoding" CRLF) - 1); |
565 } | 570 } |
566 #endif | 571 #endif |
567 | 572 |