浏览代码

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

ffdfgdfg 4 年之前
父节点
当前提交
720f842d4b
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      server/proxy/http.go

+ 2 - 1
server/proxy/http.go

@@ -177,7 +177,8 @@ reset:
 			}
 			}
 		}()
 		}()
 		for {
 		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
 				return
 			} else {
 			} else {
 				//if the cache is start and the response is in the extension,store the response to the cache list
 				//if the cache is start and the response is in the extension,store the response to the cache list