|
@ -199,7 +199,8 @@ func (c *ChunkReadAt) readChunkSliceAt(buffer []byte, chunkView *ChunkView, next |
|
|
return fetchChunkRange(buffer, c.readerCache.lookupFileIdFn, chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped, int64(offset)) |
|
|
return fetchChunkRange(buffer, c.readerCache.lookupFileIdFn, chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped, int64(offset)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
n, err = c.readerCache.ReadChunkAt(buffer, chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped, int64(offset), int(chunkView.ChunkSize), (uint64(chunkView.ViewOffset)+chunkView.ChunkSize) <= c.readerCache.chunkCache.GetMaxFilePartSizeInCache()) |
|
|
|
|
|
|
|
|
shouldCache := (uint64(chunkView.ViewOffset) + chunkView.ChunkSize) <= c.readerCache.chunkCache.GetMaxFilePartSizeInCache() |
|
|
|
|
|
n, err = c.readerCache.ReadChunkAt(buffer, chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped, int64(offset), int(chunkView.ChunkSize), shouldCache) |
|
|
if c.lastChunkFid != chunkView.FileId { |
|
|
if c.lastChunkFid != chunkView.FileId { |
|
|
if chunkView.OffsetInChunk == 0 { // start of a new chunk
|
|
|
if chunkView.OffsetInChunk == 0 { // start of a new chunk
|
|
|
if c.lastChunkFid != "" { |
|
|
if c.lastChunkFid != "" { |
|
|