优化内容为空的缓存

This commit is contained in:
刘祥超
2022-12-14 15:26:18 +08:00
parent ebb6ebd10c
commit 5cf84efccd
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
})