MCPcopy
hub / github.com/syncthing/syncthing / clearAddresses

Method clearAddresses

lib/nat/structs.go:44–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44func (m *Mapping) clearAddresses() {
45 m.mut.Lock()
46 change := len(m.extAddresses) > 0
47 for id, addr := range m.extAddresses {
48 l.Debugf("Clearing mapping %s: ID: %s Address: %s", m, id, addr)
49 delete(m.extAddresses, id)
50 }
51 m.expires = time.Time{}
52 m.mut.Unlock()
53 if change {
54 m.notify()
55 }
56}
57
58func (m *Mapping) notify() {
59 m.mut.RLock()

Callers 2

ServeMethod · 0.45
RemoveMappingMethod · 0.45

Calls 3

notifyMethod · 0.95
DebugfMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected