comparison src/http/ngx_http_header_filter_module.c @ 578:f3a9e57d2e17

Merge with current.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 11 Mar 2010 21:27:17 +0300
parents da3c99095432
children be4f34123024
comparison
equal deleted inserted replaced
539:5f4de8cf0d9d 578:f3a9e57d2e17
130 130
131 131
132 ngx_http_header_out_t ngx_http_headers_out[] = { 132 ngx_http_header_out_t ngx_http_headers_out[] = {
133 { ngx_string("Server"), offsetof(ngx_http_headers_out_t, server) }, 133 { ngx_string("Server"), offsetof(ngx_http_headers_out_t, server) },
134 { ngx_string("Date"), offsetof(ngx_http_headers_out_t, date) }, 134 { ngx_string("Date"), offsetof(ngx_http_headers_out_t, date) },
135 #if 0
136 { ngx_string("Content-Type"),
137 offsetof(ngx_http_headers_out_t, content_type) },
138 #endif
139 { ngx_string("Content-Length"), 135 { ngx_string("Content-Length"),
140 offsetof(ngx_http_headers_out_t, content_length) }, 136 offsetof(ngx_http_headers_out_t, content_length) },
141 { ngx_string("Content-Encoding"), 137 { ngx_string("Content-Encoding"),
142 offsetof(ngx_http_headers_out_t, content_encoding) }, 138 offsetof(ngx_http_headers_out_t, content_encoding) },
143 { ngx_string("Location"), offsetof(ngx_http_headers_out_t, location) }, 139 { ngx_string("Location"), offsetof(ngx_http_headers_out_t, location) },
397 } else { 393 } else {
398 len += sizeof("Connection: closed" CRLF) - 1; 394 len += sizeof("Connection: closed" CRLF) - 1;
399 } 395 }
400 396
401 #if (NGX_HTTP_GZIP) 397 #if (NGX_HTTP_GZIP)
402 if (r->gzip && clcf->gzip_vary) { 398 if (r->gzip_vary) {
403 len += sizeof("Vary: Accept-Encoding" CRLF) - 1; 399 if (clcf->gzip_vary) {
400 len += sizeof("Vary: Accept-Encoding" CRLF) - 1;
401
402 } else {
403 r->gzip_vary = 0;
404 }
404 } 405 }
405 #endif 406 #endif
406 407
407 part = &r->headers_out.headers.part; 408 part = &r->headers_out.headers.part;
408 header = part->elts; 409 header = part->elts;
531 532
532 /* update r->headers_out.location->value for possible logging */ 533 /* update r->headers_out.location->value for possible logging */
533 534
534 r->headers_out.location->value.len = b->last - p; 535 r->headers_out.location->value.len = b->last - p;
535 r->headers_out.location->value.data = p; 536 r->headers_out.location->value.data = p;
536 r->headers_out.location->key.len = sizeof("Location: ") - 1; 537 r->headers_out.location->key.len = sizeof("Location") - 1;
537 r->headers_out.location->key.data = (u_char *) "Location: "; 538 r->headers_out.location->key.data = (u_char *) "Location";
538 539
539 *b->last++ = CR; *b->last++ = LF; 540 *b->last++ = CR; *b->last++ = LF;
540 } 541 }
541 542
542 if (r->chunked) { 543 if (r->chunked) {
557 b->last = ngx_cpymem(b->last, "Connection: close" CRLF, 558 b->last = ngx_cpymem(b->last, "Connection: close" CRLF,
558 sizeof("Connection: close" CRLF) - 1); 559 sizeof("Connection: close" CRLF) - 1);
559 } 560 }
560 561
561 #if (NGX_HTTP_GZIP) 562 #if (NGX_HTTP_GZIP)
562 if (r->gzip && clcf->gzip_vary) { 563 if (r->gzip_vary) {
563 b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF, 564 b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF,
564 sizeof("Vary: Accept-Encoding" CRLF) - 1); 565 sizeof("Vary: Accept-Encoding" CRLF) - 1);
565 } 566 }
566 #endif 567 #endif
567 568