all: set timeout for re-bootstrapping

This commit is contained in:
Cuong Manh Le
2023-03-10 09:25:29 +07:00
committed by Cuong Manh Le
parent fa50cd4df4
commit 85c95a6a3a
4 changed files with 47 additions and 14 deletions
+5 -1
View File
@@ -12,6 +12,11 @@ import (
)
func (uc *UpstreamConfig) setupDOH3Transport() {
uc.setupDOH3TransportWithoutPingUpstream()
uc.pingUpstream()
}
func (uc *UpstreamConfig) setupDOH3TransportWithoutPingUpstream() {
rt := &http3.RoundTripper{}
rt.Dial = func(ctx context.Context, addr string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlyConnection, error) {
host := addr
@@ -36,5 +41,4 @@ func (uc *UpstreamConfig) setupDOH3Transport() {
}
uc.http3RoundTripper = rt
uc.pingUpstream()
}