Mercurial > hg > nginx
comparison src/http/modules/ngx_http_limit_req_module.c @ 5166:fc595eeb6c54
Limit req: rate should be non-zero.
Specifying zero rate caused division by zero when calculating delays.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Wed, 03 Apr 2013 14:13:35 +0000 |
parents | 00e4459739ed |
children | 5483d9e77b32 |
comparison
equal
deleted
inserted
replaced
5148:4bcd35e7a0f0 | 5166:fc595eeb6c54 |
---|---|
793 scale = 60; | 793 scale = 60; |
794 len -= 3; | 794 len -= 3; |
795 } | 795 } |
796 | 796 |
797 rate = ngx_atoi(value[i].data + 5, len - 5); | 797 rate = ngx_atoi(value[i].data + 5, len - 5); |
798 if (rate <= NGX_ERROR) { | 798 if (rate <= 0) { |
799 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 799 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
800 "invalid rate \"%V\"", &value[i]); | 800 "invalid rate \"%V\"", &value[i]); |
801 return NGX_CONF_ERROR; | 801 return NGX_CONF_ERROR; |
802 } | 802 } |
803 | 803 |