Mercurial > hg > nginx
changeset 3136:47b7b6ac433e
do not pass buf with empty cached response,
this fixes "zero size buf in output" alert
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 15 Sep 2009 15:12:03 +0000 |
parents | 784126370092 |
children | 179f6dfcb7fe |
files | src/http/ngx_http_file_cache.c |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_file_cache.c Tue Sep 15 11:57:29 2009 +0000 +++ b/src/http/ngx_http_file_cache.c Tue Sep 15 15:12:03 2009 +0000 @@ -767,6 +767,7 @@ ngx_int_t ngx_http_cache_send(ngx_http_request_t *r) { + off_t size; ngx_int_t rc; ngx_buf_t *b; ngx_chain_t out; @@ -795,10 +796,15 @@ return rc; } + size = c->length - c->body_start; + if (size == 0) { + return rc; + } + b->file_pos = c->body_start; b->file_last = c->length; - b->in_file = (c->length - c->body_start) ? 1: 0; + b->in_file = size ? 1: 0; b->last_buf = (r == r->main) ? 1: 0; b->last_in_chain = 1;