Skip to content

Commit

Permalink
Use io.ReadFull in Chunker
Browse files Browse the repository at this point in the history
  • Loading branch information
mcastorina committed Sep 30, 2023
1 parent 0cf06ba commit e756252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sources/chunker.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Chunker(originalChunk *Chunk) chan *Chunk {
chunkBytes := make([]byte, TotalChunkSize)
chunk := *originalChunk
chunkBytes = chunkBytes[:ChunkSize]
n, err := reader.Read(chunkBytes)
n, err := io.ReadFull(reader, chunkBytes)
if n > 0 {
peekData, _ := reader.Peek(TotalChunkSize - n)
chunkBytes = append(chunkBytes[:n], peekData...)
Expand Down

0 comments on commit e756252

Please sign in to comment.