Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
Missing the len of crc32 when calculating maxLen in WriteChunks (#494)
Browse files Browse the repository at this point in the history
Signed-off-by: naivewong <867245430@qq.com>
  • Loading branch information
naivewong authored and gouthamve committed Jan 14, 2019
1 parent a360aa3 commit bff5aa4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions chunks/chunks.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func (w *Writer) WriteChunks(chks ...Meta) error {
for _, c := range chks {
maxLen += binary.MaxVarintLen32 + 1 // The number of bytes in the chunk and its encoding.
maxLen += int64(len(c.Chunk.Bytes()))
maxLen += 4 // The 4 bytes of crc32
}
newsz := w.n + maxLen

Expand Down

0 comments on commit bff5aa4

Please sign in to comment.