Skip to content

Commit f07ac1a

Browse files
authored
fix: remove muxer recv chan to prevent double close (#785)
1 parent 69e7f96 commit f07ac1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

muxer/muxer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,11 @@ func (m *Muxer) readLoop() {
245245
// Close receiver channels
246246
m.protocolReceiversMutex.Lock()
247247
for _, protocolRoles := range m.protocolReceivers {
248-
for _, recvChan := range protocolRoles {
248+
for protocolRole, recvChan := range protocolRoles {
249+
// Signal shutdown to protocol
249250
close(recvChan)
251+
// Remove mapping
252+
delete(protocolRoles, protocolRole)
250253
}
251254
}
252255
m.protocolReceiversMutex.Unlock()

0 commit comments

Comments
 (0)