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
Browse files Browse the repository at this point in the history
  • Loading branch information
naivewong committed Jan 11, 2019
1 parent 8d991bd commit 83e5730
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 83e5730

Please sign in to comment.