From 5ec68f6453a0ed164a8fd73e024edb75344e967d Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Wed, 28 Jul 2004 16:16:50 +0000 Subject: nginx-0.0.9-2004-07-28-20:16:50 import --- src/http/ngx_http_write_filter.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/http') diff --git a/src/http/ngx_http_write_filter.c b/src/http/ngx_http_write_filter.c index 2c0989d0a..c6cc6519a 100644 --- a/src/http/ngx_http_write_filter.c +++ b/src/http/ngx_http_write_filter.c @@ -40,7 +40,7 @@ ngx_module_t ngx_http_write_filter_module = { ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) { int last; - off_t size, flush, sent; + off_t size, flush, sent, bsize; ngx_chain_t *cl, *ln, **ll, *chain; ngx_connection_t *c; ngx_http_core_loc_conf_t *clcf; @@ -82,7 +82,13 @@ ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) *ll = cl; ll = &cl->next; - size += ngx_buf_size(cl->buf); + bsize = ngx_buf_size(cl->buf); + + if (bsize == 0 && cl->buf->in_file) { + cl->buf->in_file = 0; + } + + size += bsize; if (cl->buf->flush || cl->buf->recycled) { flush = size; -- cgit