set delay only when almost whole sendfile_max_chunk was transferred
This commit is contained in:
parent
3d442cfe0f
commit
8ad43bb779
1 changed files with 4 additions and 1 deletions
|
@ -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 a new issue