@@ -56,7 +56,7 @@ type dot struct {
5656 echlastattempt atomic.Int64 // last attempt fetching ech cfg; unix milli
5757
5858 est core.P2QuantileEstimator
59- status * core. Volatile [ int ]
59+ status atomic. Int32
6060}
6161
6262var _ dnsx.Transport = (* dot )(nil )
@@ -109,7 +109,6 @@ func NewTLSTransport(ctx context.Context, id, rawurl string, addrs []string, px
109109 skipTLSVerify : skipTLSVerify ,
110110 addrport : addrport , // may or may not be ipaddr
111111 port : port ,
112- status : core .NewVolatile (x .Start ),
113112 proxies : px ,
114113 relay : relay ,
115114 relayref : relayref ,
@@ -118,6 +117,7 @@ func NewTLSTransport(ctx context.Context, id, rawurl string, addrs []string, px
118117 est : core .NewP50Estimator (ctx ),
119118 // echconfig/echlastattempt: zero values (nil) are fine
120119 }
120+ t .status .Store (dnsx .Start )
121121 echcfg := t .getOrCreateEchConfigIfNeeded ()
122122 // local dialer: protect.MakeNsDialer(id, ctl)
123123 t .c = dnsclient (tlscfg )
@@ -407,7 +407,7 @@ func (t *dot) IPPorts() (ipps []netip.AddrPort) {
407407 return
408408}
409409
410- func (t * dot ) Status () int {
410+ func (t * dot ) Status () int32 {
411411 if px := t .GetRelay (); px != nil {
412412 if y , to := dnsx .OverrideStatusFrom (px ); y {
413413 return to
@@ -417,7 +417,7 @@ func (t *dot) Status() int {
417417 if s == dnsx .Paused {
418418 // paused status is a pseudo state dependent on underlying relay
419419 // or requested pid, not a permanent state of this transport.
420- t .status .Cas (s , dnsx .Unpaused )
420+ t .status .CompareAndSwap (s , dnsx .Unpaused )
421421 return dnsx .Unpaused
422422 }
423423 return s
0 commit comments