From 439603c9e7b3b2c3601aa0c528665dbcb53a9616 Mon Sep 17 00:00:00 2001 From: Mygod Date: Tue, 30 May 2023 11:37:39 -0400 Subject: [PATCH] Handle network closing in quietReader --- forwardproxy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forwardproxy.go b/forwardproxy.go index 65f79c9..dd01a27 100644 --- a/forwardproxy.go +++ b/forwardproxy.go @@ -652,7 +652,8 @@ type quietReader struct { func (r quietReader) Read(p []byte) (n int, err error) { n, err = r.reader.Read(p) - if errors.Is(err, syscall.ECONNRESET) { + if err != nil && (errors.Is(err, syscall.ECONNRESET) || + strings.HasSuffix(err.Error(), "use of closed network connection")) { err = io.EOF } return