Merge pull request #1682 from infastin/fix/sender-deadlock

fix(core): potential sender goroutine deadlock
This commit is contained in:
Alex X
2025-04-08 11:26:18 +03:00
committed by GitHub

View File

@@ -139,13 +139,13 @@ func (s *Sender) Start() {
}
s.done = make(chan struct{})
go func() {
// for range on nil chan is OK
for packet := range s.buf {
// pass buf directly so that it's impossible for buf to be nil
go func(buf chan *Packet) {
for packet := range buf {
s.Output(packet)
}
close(s.done)
}()
}(s.buf)
}
func (s *Sender) Wait() {