mirror of
https://github.com/containers/skopeo.git
synced 2025-09-22 18:37:21 +00:00
Update vendor of containers/common and containers/storage
We are preparing for RHEL 8.4 release and want to make sure all container tools have the same containers suppackages. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
20
vendor/github.com/klauspost/compress/zstd/decoder.go
generated
vendored
20
vendor/github.com/klauspost/compress/zstd/decoder.go
generated
vendored
@@ -85,6 +85,10 @@ func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) {
|
||||
d.current.output = make(chan decodeOutput, d.o.concurrent)
|
||||
d.current.flushed = true
|
||||
|
||||
if r == nil {
|
||||
d.current.err = ErrDecoderNilInput
|
||||
}
|
||||
|
||||
// Transfer option dicts.
|
||||
d.dicts = make(map[uint32]dict, len(d.o.dicts))
|
||||
for _, dc := range d.o.dicts {
|
||||
@@ -111,7 +115,7 @@ func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) {
|
||||
// When the stream is done, io.EOF will be returned.
|
||||
func (d *Decoder) Read(p []byte) (int, error) {
|
||||
if d.stream == nil {
|
||||
return 0, errors.New("no input has been initialized")
|
||||
return 0, ErrDecoderNilInput
|
||||
}
|
||||
var n int
|
||||
for {
|
||||
@@ -152,12 +156,20 @@ func (d *Decoder) Read(p []byte) (int, error) {
|
||||
|
||||
// Reset will reset the decoder the supplied stream after the current has finished processing.
|
||||
// Note that this functionality cannot be used after Close has been called.
|
||||
// Reset can be called with a nil reader to release references to the previous reader.
|
||||
// After being called with a nil reader, no other operations than Reset or DecodeAll or Close
|
||||
// should be used.
|
||||
func (d *Decoder) Reset(r io.Reader) error {
|
||||
if d.current.err == ErrDecoderClosed {
|
||||
return d.current.err
|
||||
}
|
||||
|
||||
d.drainOutput()
|
||||
|
||||
if r == nil {
|
||||
return errors.New("nil Reader sent as input")
|
||||
d.current.err = ErrDecoderNilInput
|
||||
d.current.flushed = true
|
||||
return nil
|
||||
}
|
||||
|
||||
if d.stream == nil {
|
||||
@@ -166,8 +178,6 @@ func (d *Decoder) Reset(r io.Reader) error {
|
||||
go d.startStreamDecoder(d.stream)
|
||||
}
|
||||
|
||||
d.drainOutput()
|
||||
|
||||
// If bytes buffer and < 1MB, do sync decoding anyway.
|
||||
if bb, ok := r.(*bytes.Buffer); ok && bb.Len() < 1<<20 {
|
||||
if debug {
|
||||
@@ -249,7 +259,7 @@ func (d *Decoder) drainOutput() {
|
||||
// Any error encountered during the write is also returned.
|
||||
func (d *Decoder) WriteTo(w io.Writer) (int64, error) {
|
||||
if d.stream == nil {
|
||||
return 0, errors.New("no input has been initialized")
|
||||
return 0, ErrDecoderNilInput
|
||||
}
|
||||
var n int64
|
||||
for {
|
||||
|
Reference in New Issue
Block a user