summaryrefslogtreecommitdiff
path: root/vendor/github.com/ulikunitz/xz/writer.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-03-29 06:16:27 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-03-29 06:16:27 -0400
commit366001fb5fa96b3b0f2f9e84b7ebc56dc4c94adc (patch)
treef0bb3892c5fdf7fc1704dcd28a46b4aa751ff593 /vendor/github.com/ulikunitz/xz/writer.go
parent684b4bd2f16d078edd25d262bb8baefc699508e9 (diff)
downloadpodman-366001fb5fa96b3b0f2f9e84b7ebc56dc4c94adc.tar.gz
podman-366001fb5fa96b3b0f2f9e84b7ebc56dc4c94adc.tar.bz2
podman-366001fb5fa96b3b0f2f9e84b7ebc56dc4c94adc.zip
Update vendor of boltdb and containers/image
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/ulikunitz/xz/writer.go')
-rw-r--r--vendor/github.com/ulikunitz/xz/writer.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/vendor/github.com/ulikunitz/xz/writer.go b/vendor/github.com/ulikunitz/xz/writer.go
index c126f7099..aec10dfa6 100644
--- a/vendor/github.com/ulikunitz/xz/writer.go
+++ b/vendor/github.com/ulikunitz/xz/writer.go
@@ -1,4 +1,4 @@
-// Copyright 2014-2017 Ulrich Kunitz. All rights reserved.
+// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -18,8 +18,10 @@ type WriterConfig struct {
DictCap int
BufSize int
BlockSize int64
- // checksum method: CRC32, CRC64 or SHA256
+ // checksum method: CRC32, CRC64 or SHA256 (default: CRC64)
CheckSum byte
+ // Forces NoChecksum (default: false)
+ NoCheckSum bool
// match algorithm
Matcher lzma.MatchAlgorithm
}
@@ -41,6 +43,9 @@ func (c *WriterConfig) fill() {
if c.CheckSum == 0 {
c.CheckSum = CRC64
}
+ if c.NoCheckSum {
+ c.CheckSum = None
+ }
}
// Verify checks the configuration for errors. Zero values will be
@@ -284,7 +289,11 @@ func (c *WriterConfig) newBlockWriter(xz io.Writer, hash hash.Hash) (bw *blockWr
if err != nil {
return nil, err
}
- bw.mw = io.MultiWriter(bw.w, bw.hash)
+ if bw.hash.Size() != 0 {
+ bw.mw = io.MultiWriter(bw.w, bw.hash)
+ } else {
+ bw.mw = bw.w
+ }
return bw, nil
}