fix http cache panic, fix #626, fix #509

pull/648/head
ffdfgdfg 2020-10-06 00:57:10 +08:00
parent 5224307da7
commit 720f842d4b
1 changed files with 2 additions and 1 deletions

View File

@ -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