activityFor returns owner's wake channel, lazily allocating it on first use. Channels are kept for the life of the server; with a small number of distinct clients per server this is fine.
(owner [frame.ClientIDLen]byte)
| 900 | // use. Channels are kept for the life of the server; with a small number of |
| 901 | // distinct clients per server this is fine. |
| 902 | func (s *Server) activityFor(owner [frame.ClientIDLen]byte) chan struct{} { |
| 903 | s.mu.Lock() |
| 904 | defer s.mu.Unlock() |
| 905 | ch, ok := s.activity[owner] |
| 906 | if !ok { |
| 907 | ch = make(chan struct{}, 1) |
| 908 | s.activity[owner] = ch |
| 909 | } |
| 910 | return ch |
| 911 | } |
| 912 | |
| 913 | func (s *Server) isDialSuppressed(target string) bool { |
| 914 | now := time.Now() |
no outgoing calls
no test coverage detected