Quiet down TCP RST packet error on read operation
This commit is contained in:
parent
ab8d7d2e78
commit
89dc466b23
3 changed files with 58 additions and 2 deletions
16
pkg/tcp/proxy_unix.go
Normal file
16
pkg/tcp/proxy_unix.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// isReadConnResetError reports whether err is a connection reset error during a read operation.
|
||||
func isReadConnResetError(err error) bool {
|
||||
var oerr *net.OpError
|
||||
return errors.As(err, &oerr) && oerr.Op == "read" && errors.Is(err, syscall.ECONNRESET)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue