This commit is contained in:
2025-03-07 09:38:51 +08:00
parent 5e441c068f
commit 1e00348e84
3 changed files with 10 additions and 2 deletions

View File

@@ -48,6 +48,8 @@ int is_ip_in_cache(const char *ip)
struct ip_cache_node *current = ip_cache_head;
struct ip_cache_node *prev = NULL;
if (ip_cache_head == NULL) return 0; // 如果 ip_cache_head == NULLcurrent->next 可能导致段错误 (Segmentation Fault)。
while (current != NULL) {
// 如果 IP 匹配并且未过期
if (strcmp(current->ip, ip) == 0) {