@@ -168,11 +168,11 @@ static ngx_int_t ngx_http_waf_check_cc_ipv4(ngx_http_request_t* r, ngx_int_t* ou
168
168
169
169
unsigned long ipv4 = sin -> sin_addr .s_addr ;
170
170
171
- if (srv_conf -> ngx_waf_cc_deny == 0 || srv_conf -> ngx_waf_cc_deny == NGX_CONF_UNSET ) {
171
+ if (srv_conf -> waf_cc_deny == 0 || srv_conf -> waf_cc_deny == NGX_CONF_UNSET ) {
172
172
return NOT_MATCHED ;
173
173
}
174
- if (srv_conf -> ngx_waf_cc_deny_limit == NGX_CONF_UNSET
175
- || srv_conf -> ngx_waf_cc_deny_duration == NGX_CONF_UNSET ) {
174
+ if (srv_conf -> waf_cc_deny_limit == NGX_CONF_UNSET
175
+ || srv_conf -> waf_cc_deny_duration == NGX_CONF_UNSET ) {
176
176
ngx_log_error (NGX_LOG_ERR , r -> connection -> log , 0 , "ngx_waf: CC-DENY-CONF-INVALID" );
177
177
return NOT_MATCHED ;
178
178
}
@@ -199,11 +199,11 @@ static ngx_int_t ngx_http_waf_check_cc_ipv4(ngx_http_request_t* r, ngx_int_t* ou
199
199
HASH_ADD_INT (srv_conf -> ipv4_times , key , hash_item );
200
200
}
201
201
else {
202
- if (difftime (now , hash_item -> start_time ) >= srv_conf -> ngx_waf_cc_deny_duration * 60.0 ) {
202
+ if (difftime (now , hash_item -> start_time ) >= srv_conf -> waf_cc_deny_duration * 60.0 ) {
203
203
HASH_DEL (srv_conf -> ipv4_times , hash_item );
204
204
}
205
205
else {
206
- if (hash_item -> times > (ngx_uint_t )srv_conf -> ngx_waf_cc_deny_limit ) {
206
+ if (hash_item -> times > (ngx_uint_t )srv_conf -> waf_cc_deny_limit ) {
207
207
ctx -> blocked = TRUE;
208
208
strcpy ((char * )ctx -> rule_type , "CC-DENY" );
209
209
strcpy ((char * )ctx -> rule_deatils , "" );
@@ -420,7 +420,7 @@ static ngx_int_t ngx_http_waf_free_hash_table(ngx_http_request_t* r, ngx_http_wa
420
420
}
421
421
for (; srv_conf -> ipv4_times_old_cur != NULL && count < 100 ; srv_conf -> ipv4_times_old_cur = p -> hh .next ) {
422
422
/* 判断当前的记录是否过期 */
423
- if (difftime (now , srv_conf -> ipv4_times_old_cur -> start_time ) < srv_conf -> ngx_waf_cc_deny_duration * 60.0 ) {
423
+ if (difftime (now , srv_conf -> ipv4_times_old_cur -> start_time ) < srv_conf -> waf_cc_deny_duration * 60.0 ) {
424
424
/* 在新的哈希表中查找是否存在当前记录 */
425
425
HASH_FIND_INT (srv_conf -> ipv4_times , & srv_conf -> ipv4_times_old_cur -> key , p );
426
426
if (p == NULL ) {
0 commit comments