mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-08 05:19:53 +00:00
fix(proxymux): close of closed channel
when call listener.Close() twice
This commit is contained in:
parent
34574e0339
commit
8d9b10a259
@ -248,6 +248,11 @@ func (l *subListener) Addr() net.Addr {
|
|||||||
// Close implements net.Listener.Close.
|
// Close implements net.Listener.Close.
|
||||||
// Upstream should use close(l.acceptChan) instead.
|
// Upstream should use close(l.acceptChan) instead.
|
||||||
func (l *subListener) Close() error {
|
func (l *subListener) Close() error {
|
||||||
|
select {
|
||||||
|
case <-l.closeChan:
|
||||||
|
return nil
|
||||||
|
default:
|
||||||
|
}
|
||||||
close(l.closeChan)
|
close(l.closeChan)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user