Skip to content

Commit a303575

Browse files
author
vbart
committed
Limit req: rate should be non-zero.
Specifying zero rate caused division by zero when calculating delays.
1 parent 587baf0 commit a303575

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/http/modules/ngx_http_limit_req_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
795795
}
796796

797797
rate = ngx_atoi(value[i].data + 5, len - 5);
798-
if (rate <= NGX_ERROR) {
798+
if (rate <= 0) {
799799
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
800800
"invalid rate \"%V\"", &value[i]);
801801
return NGX_CONF_ERROR;

0 commit comments

Comments
 (0)