Mercurial > hg > nginx
comparison src/http/ngx_http_write_filter_module.c @ 4383:5130c16a130e
Fixed throughput problems with large limit_rate.
Previous attempt to fix this was in r1658 (0.6.18), though that one wasn't
enough (it was a noop).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 26 Dec 2011 10:49:57 +0000 |
parents | 4f5753877376 |
children | a8b6d5dee539 |
comparison
equal
deleted
inserted
replaced
4382:b4d54fa76853 | 4383:5130c16a130e |
---|---|
260 if (nsent < 0) { | 260 if (nsent < 0) { |
261 nsent = 0; | 261 nsent = 0; |
262 } | 262 } |
263 } | 263 } |
264 | 264 |
265 delay = (ngx_msec_t) ((nsent - sent) * 1000 / r->limit_rate + 1); | 265 delay = (ngx_msec_t) ((nsent - sent) * 1000 / r->limit_rate); |
266 | 266 |
267 if (delay > 0) { | 267 if (delay > 0) { |
268 c->write->delayed = 1; | 268 c->write->delayed = 1; |
269 ngx_add_timer(c->write, delay); | 269 ngx_add_timer(c->write, delay); |
270 } | 270 } |