Browse Source

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

ffdfgdfg 4 năm trước cách đây
mục cha
commit
720f842d4b
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      server/proxy/http.go

+ 2 - 1
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