优化内容为空的缓存

This commit is contained in:
GoEdgeLab
2022-12-14 15:26:18 +08:00
parent 93b0406043
commit 15c658d303
2 changed files with 16 additions and 3 deletions

View File

@@ -1213,9 +1213,12 @@ func (this *FileStorage) hotLoop() {
}
err = reader.ReadBody(buf, func(n int) (goNext bool, err error) {
_, err = writer.Write(buf[:n])
if err == nil {
goNext = true
goNext = true
if n > 0 {
_, err = writer.Write(buf[:n])
if err != nil {
goNext = false
}
}
return
})