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.
This commit is contained in:
Cuong Manh Le
2023-05-02 15:03:53 +07:00
committed by Cuong Manh Le
parent 7a156d7d15
commit 270ea9f6ca
2 changed files with 2 additions and 2 deletions

View File

@@ -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 {

View File

@@ -20,7 +20,7 @@ import (
func (uc *UpstreamConfig) setupDOH3Transport() {
uc.setupDOH3TransportWithoutPingUpstream()
uc.pingUpstream()
go uc.pingUpstream()
}
func (uc *UpstreamConfig) newDOH3Transport(addrs []string) http.RoundTripper {