mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-04-03 03:47:39 +03:00
Wrap more error
This commit is contained in:
parent
a116134e5b
commit
a8fd6450d4
1 changed files with 6 additions and 6 deletions
|
@ -48,9 +48,9 @@ func (c *gUDPConn) Write(b []byte) (n int, err error) {
|
|||
|
||||
func wrapStackError(err tcpip.Error) error {
|
||||
switch err.(type) {
|
||||
case *tcpip.ErrClosedForSend:
|
||||
return net.ErrClosed
|
||||
case *tcpip.ErrClosedForReceive:
|
||||
case *tcpip.ErrClosedForSend,
|
||||
*tcpip.ErrClosedForReceive,
|
||||
*tcpip.ErrAborted:
|
||||
return net.ErrClosed
|
||||
}
|
||||
return wrapStackError(err)
|
||||
|
@ -59,9 +59,9 @@ func wrapStackError(err tcpip.Error) error {
|
|||
func wrapError(err error) error {
|
||||
if opErr, isOpErr := err.(*net.OpError); isOpErr {
|
||||
switch opErr.Err.Error() {
|
||||
case "endpoint is closed for send":
|
||||
return net.ErrClosed
|
||||
case "endpoint is closed for receive":
|
||||
case "endpoint is closed for send",
|
||||
"endpoint is closed for receive",
|
||||
"operation aborted":
|
||||
return net.ErrClosed
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue