mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
remove DNS lookups from IPv6 check, close the connection
log ipv6 availability logic more debugging for ipv6 availability checks more debugging for ipv6 availability checks
This commit is contained in:
2
net.go
2
net.go
@@ -18,6 +18,7 @@ const ipv6ProbingInterval = 10 * time.Second
|
||||
|
||||
func hasIPv6() bool {
|
||||
hasIPv6Once.Do(func() {
|
||||
Log(context.Background(), ProxyLogger.Load().Debug(), "checking for IPv6 availability once")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||
defer cancel()
|
||||
val := ctrldnet.IPv6Available(ctx)
|
||||
@@ -43,6 +44,7 @@ func probingIPv6(ctx context.Context, old bool) {
|
||||
if ipv6Available.CompareAndSwap(old, cur) {
|
||||
old = cur
|
||||
}
|
||||
Log(ctx, ProxyLogger.Load().Debug(), "IPv6 availability: %v", cur)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user