diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-09-22 23:23:34 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-09-22 23:23:34 +0400 |
commit | 49ee282ba12bbbcb60c2c132ccb6ff76ebc17985 (patch) | |
tree | 30c85aa3bde8531263d5c6997a1a69d4000a4e60 /src/http | |
parent | 1f1bdc12b3aa1af224909ef8585a77c86d9d1ac5 (diff) |
r1409, r1413 merge:
set delay only when almost whole sendfile_max_chunk was transferred
Diffstat (limited to 'src/http')
-rw-r--r-- | src/http/ngx_http_write_filter_module.c | 6 |
1 files changed, 5 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..e5a26f003 100644 --- a/src/http/ngx_http_write_filter_module.c +++ b/src/http/ngx_http_write_filter_module.c @@ -249,7 +249,11 @@ 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 + && (size_t) (c->sent - sent) + >= clcf->sendfile_max_chunk - 2 * ngx_pagesize) + { c->write->delayed = 1; ngx_add_timer(c->write, 1); } |