aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-08-20 10:35:41 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-08-20 10:35:41 +0000
commit7896c39fe89ba333bd3cc7fe0136a0855b164737 (patch)
treec3dd8ce4fee516e104d68ea7c7df651b02228ec4 /src
parent3854a1e195d776818475a52e5e1ce63cbda5f99a (diff)
downloadnginx-7896c39fe89ba333bd3cc7fe0136a0855b164737.tar.gz
nginx-7896c39fe89ba333bd3cc7fe0136a0855b164737.zip
set delay only when almost whole sendfile_max_chunk was transferred
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_write_filter_module.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/http/ngx_http_write_filter_module.c b/src/http/ngx_http_write_filter_module.c
index 944593ae4..b1796645e 100644
--- a/src/http/ngx_http_write_filter_module.c
+++ b/src/http/ngx_http_write_filter_module.c
@@ -249,7 +249,10 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
c->write->delayed = 1;
ngx_add_timer(c->write, (ngx_msec_t) (sent * 1000 / r->limit_rate + 1));
- } else if (c->write->ready && clcf->sendfile_max_chunk) {
+ } else if (c->write->ready
+ && clcf->sendfile_max_chunk
+ && c->sent - sent >= clcf->sendfile_max_chunk - 2 * ngx_pagesize)
+ {
c->write->delayed = 1;
ngx_add_timer(c->write, 1);
}