feat(core): 增强IPv6支持和优化功能

- 添加IPv6可用性检查,优化用户界面反馈。
- 实现IPv6检测方法,确保用户在启用IPv6时获得准确提示。
- 更新下载线程设置,修正aria2c参数以提高兼容性。
This commit is contained in:
欧阳淇淇
2025-08-02 16:12:19 +08:00
parent 291c471b9e
commit 1c749079a2
4 changed files with 127 additions and 20 deletions

View File

@@ -319,18 +319,18 @@ class CloudflareOptimizer:
success_message += f"IPv6: {self.optimized_ipv6}\n"
if hostname:
# 先清理可能存在的旧记录
# 先清理可能存在的旧记录(只清理一次)
self.hosts_manager.clean_hostname_entries(hostname)
success = False
# 应用优选IP到hosts文件
if ipv4_success:
success = self.hosts_manager.apply_ip(hostname, self.optimized_ip) or success
success = self.hosts_manager.apply_ip(hostname, self.optimized_ip, clean=False) or success
# 如果启用IPv6并且找到了IPv6地址也应用到hosts
if ipv6_success:
success = self.hosts_manager.apply_ip(hostname, self.optimized_ipv6) or success
success = self.hosts_manager.apply_ip(hostname, self.optimized_ipv6, clean=False) or success
if success:
msg_box = QtWidgets.QMessageBox(self.main_window)