Skip to content

Commit 171721c

Browse files
committed
🐛 CC detect logic error
1 parent 42ecb95 commit 171721c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

inc/ngx_http_waf_module_check.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ static ngx_int_t ngx_http_waf_handler_check_cc_ipv4(ngx_http_request_t* r, ngx_i
220220
}
221221
}
222222
else {
223-
++(hash_item->times);
223+
if (difftime(now, hash_item->start_time) > 60.0) {
224+
HASH_DEL(srv_conf->ipv4_times, hash_item);
225+
}
226+
else {
227+
++(hash_item->times);
228+
}
224229
}
225230
}
226231
return NOT_MATCHED;

0 commit comments

Comments
 (0)