mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	优化HTTP缓存,主要是并发冲突、缓存写入不全等问题
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
			
		||||
package nodes
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
 | 
			
		||||
	"github.com/iwind/TeaGo/Tea"
 | 
			
		||||
	"github.com/iwind/TeaGo/logs"
 | 
			
		||||
	"io"
 | 
			
		||||
@@ -50,7 +51,11 @@ func (this *HTTPRequest) doPage(status int) (shouldStop bool) {
 | 
			
		||||
				_, err = io.CopyBuffer(this.writer, fp, buf)
 | 
			
		||||
				bytePool1k.Put(buf)
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					logs.Error(err)
 | 
			
		||||
					if !this.canIgnore(err) {
 | 
			
		||||
						remotelogs.Warn("HTTP_REQUEST_PAGE", "write to client failed: "+err.Error())
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					this.writer.SetOk()
 | 
			
		||||
				}
 | 
			
		||||
				err = fp.Close()
 | 
			
		||||
				if err != nil {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user