FIXME: This is a hack removeFlushEntry is needed when we need to discard queued up responses for our pings as part of a flush call. This happens when we have a flush call outstanding and we call close.
(ch chan struct{})
| 5746 | // for our pings as part of a flush call. This happens when we have a flush |
| 5747 | // call outstanding and we call close. |
| 5748 | func (nc *Conn) removeFlushEntry(ch chan struct{}) bool { |
| 5749 | nc.mu.Lock() |
| 5750 | defer nc.mu.Unlock() |
| 5751 | if nc.pongs == nil { |
| 5752 | return false |
| 5753 | } |
| 5754 | for i, c := range nc.pongs { |
| 5755 | if c == ch { |
| 5756 | nc.pongs[i] = nil |
| 5757 | return true |
| 5758 | } |
| 5759 | } |
| 5760 | return false |
| 5761 | } |
| 5762 | |
| 5763 | // The lock must be held entering this function. |
| 5764 | func (nc *Conn) sendPing(ch chan struct{}) { |
no outgoing calls
no test coverage detected