Skip to content

Commit

Permalink
Missing the len of crc32 when calculating maxLen in WriteChunks (prom…
Browse files Browse the repository at this point in the history
…etheus-junkyard#494)

Signed-off-by: naivewong <867245430@qq.com>
  • Loading branch information
naivewong authored and Radoslaw Lesniewski committed Jan 18, 2019
1 parent f2827ce commit 39024e1
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 39024e1

Please sign in to comment.