From 270ea9f6ca5ad3050e2b57f4a4beddf30b6ea544 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Tue, 2 May 2023 15:03:53 +0700 Subject: [PATCH] Do not block when ping upstream Because the network may not be available at the time ping upstream happens, so ctrld will stuck there waiting for pinging upstream. --- config.go | 2 +- config_quic.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index a85cbd0..bef32e3 100644 --- a/config.go +++ b/config.go @@ -297,7 +297,7 @@ func (uc *UpstreamConfig) SetupTransport() { func (uc *UpstreamConfig) setupDOHTransport() { uc.setupDOHTransportWithoutPingUpstream() - uc.pingUpstream() + go uc.pingUpstream() } func (uc *UpstreamConfig) newDOHTransport(addrs []string) *http.Transport { diff --git a/config_quic.go b/config_quic.go index ad695a8..b6861b6 100644 --- a/config_quic.go +++ b/config_quic.go @@ -20,7 +20,7 @@ import ( func (uc *UpstreamConfig) setupDOH3Transport() { uc.setupDOH3TransportWithoutPingUpstream() - uc.pingUpstream() + go uc.pingUpstream() } func (uc *UpstreamConfig) newDOH3Transport(addrs []string) http.RoundTripper {