fix: 双栈位置上报
This commit is contained in:
+4
-6
@@ -38,19 +38,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 {
|
||||
if ipv6 != "" && useIPv6CountryCode {
|
||||
GeoQueryIP = ipv6
|
||||
} else {
|
||||
GeoQueryIP = ipv4
|
||||
}
|
||||
|
||||
time.Sleep(time.Second * time.Duration(period))
|
||||
|
||||
Reference in New Issue
Block a user