fix: tcp-ping

This commit is contained in:
naiba committed 2024-07-28 18:48:44 +08:00
1 parent c50a21c5b1
commit fa0cc9bb7a
3 files changed
+31 -5

No files matched your search

+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
}