MCPcopy
hub / github.com/syncthing/syncthing / setConnectionStatus

Method setConnectionStatus

lib/connections/service.go:1000–1014  ·  view source on GitHub ↗
(address string, err error)

Source from the content-addressed store, hash-verified

998}
999
1000func (s *connectionStatusHandler) setConnectionStatus(address string, err error) {
1001 if errors.Is(err, context.Canceled) {
1002 return
1003 }
1004
1005 status := ConnectionStatusEntry{When: time.Now().UTC().Truncate(time.Second)}
1006 if err != nil {
1007 errStr := err.Error()
1008 status.Error = &errStr
1009 }
1010
1011 s.connectionStatusMut.Lock()
1012 s.connectionStatus[address] = status
1013 s.connectionStatusMut.Unlock()
1014}
1015
1016func (s *service) NATType() string {
1017 s.listenersMut.RLock()

Callers 3

resolveDialTargetsMethod · 0.80
dialParallelMethod · 0.80
TestConnectionStatusFunction · 0.80

Calls 5

UnlockMethod · 0.80
TruncateMethod · 0.65
NowMethod · 0.65
ErrorMethod · 0.65
IsMethod · 0.45

Tested by 1

TestConnectionStatusFunction · 0.64