mirror of
https://github.com/nginx/nginx.git
synced 2024-11-29 12:14:27 -06:00
set delay only when almost whole sendfile_max_chunk was transferred
This commit is contained in:
parent
3854a1e195
commit
7896c39fe8
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user