From 720f842d4bfb6bd4b40f695d93dfc6a4e109c626 Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Tue, 6 Oct 2020 00:57:10 +0800 Subject: [PATCH] fix http cache panic, fix #626, fix #509 --- server/proxy/http.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/proxy/http.go b/server/proxy/http.go index 78a26b6..3bc1e6e 100644 --- a/server/proxy/http.go +++ b/server/proxy/http.go @@ -177,7 +177,8 @@ reset: } }() for { - if resp, err := http.ReadResponse(bufio.NewReader(connClient), r); err != nil || resp == nil { + if resp, err := http.ReadResponse(bufio.NewReader(connClient), r); err != nil || resp == nil || r == nil { + // if there got broken pipe, http.ReadResponse will get a nil return } else { //if the cache is start and the response is in the extension,store the response to the cache list