Merge of r4962: limit_rate fix.

Limit rate: fixed integer overflow in limit calculation (ticket #256).

Patch by Alexey Antropov.
This commit is contained in:
Maxim Dounin 2013-02-10 03:20:00 +00:00
parent 18429a3d73
commit aecf7f8171
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
}
if (r->limit_rate) {
limit = r->limit_rate * (ngx_time() - r->start_sec + 1)
limit = (off_t) r->limit_rate * (ngx_time() - r->start_sec + 1)
- (c->sent - clcf->limit_rate_after);
if (limit <= 0) {