Fix broken pipe check

This commit is contained in:
世界 2022-07-18 11:56:59 +08:00
parent cb7239c6a7
commit 3d74b823ed
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -9,6 +9,7 @@ import (
"github.com/sagernet/sing/common"
F "github.com/sagernet/sing/common/format"
"syscall"
)
type Handler interface {
@ -49,5 +50,5 @@ func IsCanceled(err error) bool {
}
func IsClosed(err error) bool {
return IsMulti(err, io.EOF, net.ErrClosed, io.ErrClosedPipe, os.ErrClosed)
return IsMulti(err, io.EOF, net.ErrClosed, io.ErrClosedPipe, os.ErrClosed, syscall.EPIPE)
}