forked from quic-go/quic-go
don't block sendQueue.Send() if the runloop already exited.
This can lead to a deadlock where session.shutdown() never exits because it is blocked on a Send() but the sendQueue has exited due to a write error.
This commit is contained in:
@@ -18,7 +18,10 @@ func newSendQueue(conn connection) *sendQueue {
|
||||
}
|
||||
|
||||
func (h *sendQueue) Send(p *packetBuffer) {
|
||||
h.queue <- p
|
||||
select {
|
||||
case h.queue <- p:
|
||||
case <-h.runStopped:
|
||||
}
|
||||
}
|
||||
|
||||
func (h *sendQueue) Run() error {
|
||||
|
||||
Reference in New Issue
Block a user