comparison src/http/ngx_http_file_cache.c @ 540:005a70f9573b NGINX_0_8_16

nginx 0.8.16 *) Feature: the "image_filter_transparency" directive. *) Bugfix: "addition_types" directive was incorrectly named "addtion_types". *) Bugfix: resolver cache poisoning. Thanks to Matthew Dempsky. *) Bugfix: memory leak in resolver. Thanks to Matthew Dempsky. *) Bugfix: invalid request line in $request variable was written in access_log only if error_log was set to "info" or "debug" level. *) Bugfix: in PNG alpha-channel support in the ngx_http_image_filter_module. *) Bugfix: nginx always added "Vary: Accept-Encoding" response header line, if both "gzip_static" and "gzip_vary" were on. *) Bugfix: in UTF-8 encoding support by "try_files" directive in nginx/Windows. *) Bugfix: in "post_action" directive usage; the bug had appeared in 0.8.11. Thanks to Igor Artemiev.
author Igor Sysoev <http://sysoev.ru>
date Tue, 22 Sep 2009 00:00:00 +0400
parents 86dad910eeb6
children f7ec98e3caeb
comparison
equal deleted inserted replaced
538:a607f3a5aefe 540:005a70f9573b
765 765
766 766
767 ngx_int_t 767 ngx_int_t
768 ngx_http_cache_send(ngx_http_request_t *r) 768 ngx_http_cache_send(ngx_http_request_t *r)
769 { 769 {
770 off_t size;
770 ngx_int_t rc; 771 ngx_int_t rc;
771 ngx_buf_t *b; 772 ngx_buf_t *b;
772 ngx_chain_t out; 773 ngx_chain_t out;
773 ngx_http_cache_t *c; 774 ngx_http_cache_t *c;
774 775
793 794
794 if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { 795 if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
795 return rc; 796 return rc;
796 } 797 }
797 798
799 size = c->length - c->body_start;
800 if (size == 0) {
801 return rc;
802 }
803
798 b->file_pos = c->body_start; 804 b->file_pos = c->body_start;
799 b->file_last = c->length; 805 b->file_last = c->length;
800 806
801 b->in_file = (c->length - c->body_start) ? 1: 0; 807 b->in_file = size ? 1: 0;
802 b->last_buf = (r == r->main) ? 1: 0; 808 b->last_buf = (r == r->main) ? 1: 0;
803 b->last_in_chain = 1; 809 b->last_in_chain = 1;
804 810
805 b->file->fd = c->file.fd; 811 b->file->fd = c->file.fd;
806 b->file->name = c->file.name; 812 b->file->name = c->file.name;