From: Maxim Dounin Date: Sun, 10 Feb 2013 03:20:00 +0000 (+0000) Subject: Merge of r4962: limit_rate fix. X-Git-Tag: release-1.2.7~24 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=4b78ff952f8c7742429430c640130b8ad95e4c3b;p=nginx.git Merge of r4962: limit_rate fix. Limit rate: fixed integer overflow in limit calculation (ticket #256). Patch by Alexey Antropov. --- diff --git a/src/http/ngx_http_write_filter_module.c b/src/http/ngx_http_write_filter_module.c index fd44bc659..5594c7faa 100644 --- a/src/http/ngx_http_write_filter_module.c +++ b/src/http/ngx_http_write_filter_module.c @@ -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) {