Mercurial > hg > nginx-vendor-current
comparison src/http/modules/ngx_http_limit_req_module.c @ 534:a52c99698e7f NGINX_0_8_19
nginx 0.8.19
*) Change: now SSLv2 protocol is disabled by default.
*) Change: now default SSL ciphers are "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM".
*) Bugfix: a "limit_req" directive did not work; the bug had appeared
in 0.8.18.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 06 Oct 2009 00:00:00 +0400 |
parents | f7ec98e3caeb |
children | ff463db0be31 |
comparison
equal
deleted
inserted
replaced
533:4a44adbff19a | 534:a52c99698e7f |
---|---|
396 now = (ngx_msec_t) (tp->sec * 1000 + tp->msec); | 396 now = (ngx_msec_t) (tp->sec * 1000 + tp->msec); |
397 ms = (ngx_msec_int_t) (now - lr->last); | 397 ms = (ngx_msec_int_t) (now - lr->last); |
398 | 398 |
399 excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000; | 399 excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000; |
400 | 400 |
401 if (excess < 0) { | |
402 excess = 0; | |
403 } | |
404 | |
401 if ((ngx_uint_t) excess > lrcf->burst) { | 405 if ((ngx_uint_t) excess > lrcf->burst) { |
402 *lrp = lr; | 406 *lrp = lr; |
403 return NGX_BUSY; | 407 return NGX_BUSY; |
404 } | |
405 | |
406 if (excess < 0) { | |
407 excess = 0; | |
408 } | 408 } |
409 | 409 |
410 lr->excess = excess; | 410 lr->excess = excess; |
411 lr->last = now; | 411 lr->last = now; |
412 | 412 |