diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2009-09-15 15:12:03 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2009-09-15 15:12:03 +0000 |
| commit | d1e95674256636c6810012aa1772eb1440579dd5 (patch) | |
| tree | 98476bc4f78036f9e6d447c4aa961379e981353b /src | |
| parent | 04c2f085f4f7de40dec3417a40854636a908dc05 (diff) | |
| download | nginx-d1e95674256636c6810012aa1772eb1440579dd5.tar.gz nginx-d1e95674256636c6810012aa1772eb1440579dd5.tar.bz2 | |
do not pass buf with empty cached response,
this fixes "zero size buf in output" alert
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/ngx_http_file_cache.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c index a6271a8e9..ca333fc14 100644 --- a/src/http/ngx_http_file_cache.c +++ b/src/http/ngx_http_file_cache.c @@ -767,6 +767,7 @@ ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf) 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 @@ ngx_http_cache_send(ngx_http_request_t *r) 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; |
