lib/connections: Actually remove listenerSupervisor (ref #7644) (#7663)

This commit is contained in:
Simon Frei 2021-05-11 14:35:13 +02:00 committed by GitHub
parent a8e2fc6f61
commit c494ced21f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,7 +146,6 @@ type service struct {
listenersMut sync.RWMutex
listeners map[string]genericListener
listenerTokens map[string]suture.ServiceToken
listenerSupervisor *suture.Supervisor
}
func NewService(cfg config.Wrapper, myID protocol.DeviceID, mdl Model, tlsCfg *tls.Config, discoverer discover.Finder, bepProtocolName string, tlsDefaultCommonName string, evLogger events.Logger) Service {
@ -725,7 +724,7 @@ func (s *service) CommitConfiguration(from, to config.Configuration) bool {
for addr, listener := range s.listeners {
if _, ok := seen[addr]; !ok || listener.Factory().Valid(to) != nil {
l.Debugln("Stopping listener", addr)
s.listenerSupervisor.Remove(s.listenerTokens[addr])
s.Remove(s.listenerTokens[addr])
delete(s.listenerTokens, addr)
delete(s.listeners, addr)
}