From e4b3d2b2aa7728d2a43832c99ad9c5dcc46f1753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 16 Jun 2021 07:52:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E6=8F=90=E7=A4=BA=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index e199435..26173a4 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -10,7 +10,6 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/stats" "github.com/TeaOSLab/EdgeNode/internal/utils" "github.com/iwind/TeaGo/types" - "golang.org/x/net/http2" "io" "net" "net/http" @@ -1154,16 +1153,14 @@ func (this *HTTPRequest) canIgnore(err error) bool { } // 客户端主动取消 - if err == context.Canceled || err == io.ErrShortWrite { + if err == context.Canceled || err == io.ErrShortWrite || strings.Contains(err.Error(), "write: connection timed out") || strings.Contains(err.Error(), "write: broken pipe") { return true } // HTTP/2流错误 - { - _, ok := err.(http2.StreamError) - if ok { - return true - } + if err.Error() == "http2: stream closed" || err.Error() == "client disconnected" { // errStreamClosed, errClientDisconnected + return true } + return false }