mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	实现基础的206 partial content缓存
This commit is contained in:
		@@ -3,6 +3,7 @@ package caches
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/binary"
 | 
			
		||||
	"errors"
 | 
			
		||||
	rangeutils "github.com/TeaOSLab/EdgeNode/internal/utils/ranges"
 | 
			
		||||
	"github.com/iwind/TeaGo/types"
 | 
			
		||||
	"io"
 | 
			
		||||
	"os"
 | 
			
		||||
@@ -332,6 +333,11 @@ func (this *FileReader) ReadBodyRange(buf []byte, start int64, end int64, callba
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ContainsRange 是否包含某些区间内容
 | 
			
		||||
func (this *FileReader) ContainsRange(r rangeutils.Range) bool {
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *FileReader) Close() error {
 | 
			
		||||
	if this.openFileCache != nil {
 | 
			
		||||
		if this.isClosed {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user