mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-12-03 15:18:39 +00:00
Fix URLTest selection and idle connection references
This commit is contained in:
@@ -24,7 +24,10 @@ func RegisterCertificateProvider(registry *certificate.Registry) {
|
||||
certificate.Register[option.TailscaleCertificateProviderOptions](registry, C.TypeTailscale, NewCertificateProvider)
|
||||
}
|
||||
|
||||
var _ adapter.CertificateProviderService = (*CertificateProvider)(nil)
|
||||
var (
|
||||
_ adapter.CertificateProviderService = (*CertificateProvider)(nil)
|
||||
_ adapter.Referrer = (*CertificateProvider)(nil)
|
||||
)
|
||||
|
||||
type CertificateProvider struct {
|
||||
certificate.Adapter
|
||||
@@ -63,6 +66,10 @@ func NewCertificateProvider(ctx context.Context, _ log.ContextLogger, tag string
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (p *CertificateProvider) References() ([]string, []string) {
|
||||
return []string{p.endpointTag}, nil
|
||||
}
|
||||
|
||||
func (p *CertificateProvider) Start(stage adapter.StartStage, scope *adapter.Scope) error {
|
||||
if stage != adapter.StartStateStart {
|
||||
return nil
|
||||
|
||||
@@ -112,6 +112,10 @@ func (t *DNSTransport) Start(stage adapter.StartStage, scope *adapter.Scope) err
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *DNSTransport) References() ([]string, []string) {
|
||||
return []string{t.endpointTag}, nil
|
||||
}
|
||||
|
||||
func (t *DNSTransport) Reset() {
|
||||
t.access.RLock()
|
||||
transports := t.collectResolversLocked()
|
||||
|
||||
@@ -249,11 +249,11 @@ func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextL
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (t *Endpoint) References() []string {
|
||||
func (t *Endpoint) References() ([]string, []string) {
|
||||
if t.detour == "" {
|
||||
return nil
|
||||
return nil, nil
|
||||
}
|
||||
return []string{t.detour}
|
||||
return []string{t.detour}, nil
|
||||
}
|
||||
|
||||
func (t *Endpoint) Start(stage adapter.StartStage, scope *adapter.Scope) error {
|
||||
|
||||
Reference in New Issue
Block a user