mirror of
https://github.com/nginx/nginx.git
synced 2025-06-13 06:12:44 +08:00
Limit rate: fixed integer overflow in limit calculation (ticket #256).
Patch by Alexey Antropov.
This commit is contained in:
parent
8ae9e7903f
commit
1a6ed2e3b1
@ -207,7 +207,7 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (r->limit_rate) {
|
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);
|
- (c->sent - clcf->limit_rate_after);
|
||||||
|
|
||||||
if (limit <= 0) {
|
if (limit <= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user