diff options
Diffstat (limited to 'weed/filer2')
| -rw-r--r-- | weed/filer2/filechunks.go | 6 | ||||
| -rw-r--r-- | weed/filer2/filechunks_test.go | 2 | ||||
| -rw-r--r-- | weed/filer2/stream.go | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go index 711488df1..fe7841fa7 100644 --- a/weed/filer2/filechunks.go +++ b/weed/filer2/filechunks.go @@ -75,7 +75,7 @@ type ChunkView struct { isGzipped bool } -func ViewFromChunks(chunks []*filer_pb.FileChunk, offset int64, size int) (views []*ChunkView) { +func ViewFromChunks(chunks []*filer_pb.FileChunk, offset int64, size int64) (views []*ChunkView) { visibles := NonOverlappingVisibleIntervals(chunks) @@ -83,9 +83,9 @@ func ViewFromChunks(chunks []*filer_pb.FileChunk, offset int64, size int) (views } -func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int) (views []*ChunkView) { +func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int64) (views []*ChunkView) { - stop := offset + int64(size) + stop := offset + size for _, chunk := range visibles { diff --git a/weed/filer2/filechunks_test.go b/weed/filer2/filechunks_test.go index bb4a6c74d..7b1133b85 100644 --- a/weed/filer2/filechunks_test.go +++ b/weed/filer2/filechunks_test.go @@ -218,7 +218,7 @@ func TestChunksReading(t *testing.T) { testcases := []struct { Chunks []*filer_pb.FileChunk Offset int64 - Size int + Size int64 Expected []*ChunkView }{ // case 0: normal diff --git a/weed/filer2/stream.go b/weed/filer2/stream.go index 0f7c3c176..8819070ff 100644 --- a/weed/filer2/stream.go +++ b/weed/filer2/stream.go @@ -14,7 +14,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/wdclient" ) -func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*filer_pb.FileChunk, offset int64, size int) error { +func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*filer_pb.FileChunk, offset int64, size int64) error { chunkViews := ViewFromChunks(chunks, offset, size) @@ -61,7 +61,7 @@ var _ = io.ReadSeeker(&ChunkStreamReader{}) func NewChunkStreamReaderFromFiler(masterClient *wdclient.MasterClient, chunks []*filer_pb.FileChunk) *ChunkStreamReader { - chunkViews := ViewFromChunks(chunks, 0, math.MaxInt32) + chunkViews := ViewFromChunks(chunks, 0, math.MaxInt64) return &ChunkStreamReader{ chunkViews: chunkViews, |
