mirror of
https://github.com/nginx/nginx.git
synced 2025-07-31 18:46:15 +08: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;
|
c->write->delayed = 1;
|
||||||
ngx_add_timer(c->write, (ngx_msec_t) (sent * 1000 / r->limit_rate + 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;
|
c->write->delayed = 1;
|
||||||
ngx_add_timer(c->write, 1);
|
ngx_add_timer(c->write, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user