fix: tcp-ping

This commit is contained in:
naiba
2024-07-28 18:48:44 +08:00
parent c50a21c5b1
commit fa0cc9bb7a
3 changed files with 31 additions and 5 deletions
+6 -3
View File
@@ -39,14 +39,17 @@ func UpdateIP(useIPv6CountryCode bool, period uint32) {
continue
}
if ipv4 == "" || ipv6 == "" {
if ipv4 == "" {
GeoQueryIP = ipv6
} else {
GeoQueryIP = ipv4
}
CachedIP = fmt.Sprintf("%s%s", ipv4, ipv6)
} else {
CachedIP = fmt.Sprintf("%s/%s", ipv4, ipv6)
}
if !useIPv6CountryCode {
GeoQueryIP = ipv4
} else {
if useIPv6CountryCode {
GeoQueryIP = ipv6
}