comparison src/http/ngx_http_header_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 507fc5ac9839
children 616da2ea901f 667c22171519
comparison
equal deleted inserted replaced
3312:dddca6f42e7b 3313:118169a8ec92
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