mirror of
https://github.com/containers/skopeo.git
synced 2025-09-03 15:46:42 +00:00
Update c/image from the main branch
> go get github.com/containers/image/v5@main > make vendor Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
12
vendor/github.com/vbatts/tar-split/archive/tar/reader.go
generated
vendored
12
vendor/github.com/vbatts/tar-split/archive/tar/reader.go
generated
vendored
@@ -41,7 +41,7 @@ type fileReader interface {
|
||||
// RawBytes accesses the raw bytes of the archive, apart from the file payload itself.
|
||||
// This includes the header and padding.
|
||||
//
|
||||
// This call resets the current rawbytes buffer
|
||||
// # This call resets the current rawbytes buffer
|
||||
//
|
||||
// Only when RawAccounting is enabled, otherwise this returns nil
|
||||
func (tr *Reader) RawBytes() []byte {
|
||||
@@ -126,7 +126,9 @@ func (tr *Reader) next() (*Header, error) {
|
||||
return nil, err
|
||||
}
|
||||
if hdr.Typeflag == TypeXGlobalHeader {
|
||||
mergePAX(hdr, paxHdrs)
|
||||
if err = mergePAX(hdr, paxHdrs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Header{
|
||||
Name: hdr.Name,
|
||||
Typeflag: hdr.Typeflag,
|
||||
@@ -381,9 +383,9 @@ func parsePAX(r io.Reader) (map[string]string, error) {
|
||||
// header in case further processing is required.
|
||||
//
|
||||
// The err will be set to io.EOF only when one of the following occurs:
|
||||
// * Exactly 0 bytes are read and EOF is hit.
|
||||
// * Exactly 1 block of zeros is read and EOF is hit.
|
||||
// * At least 2 blocks of zeros are read.
|
||||
// - Exactly 0 bytes are read and EOF is hit.
|
||||
// - Exactly 1 block of zeros is read and EOF is hit.
|
||||
// - At least 2 blocks of zeros are read.
|
||||
func (tr *Reader) readHeader() (*Header, *block, error) {
|
||||
// Two blocks of zero bytes marks the end of the archive.
|
||||
n, err := io.ReadFull(tr.r, tr.blk[:])
|
||||
|
2
vendor/github.com/vbatts/tar-split/tar/asm/assemble.go
generated
vendored
2
vendor/github.com/vbatts/tar-split/tar/asm/assemble.go
generated
vendored
@@ -71,6 +71,8 @@ func WriteOutputTarStream(fg storage.FileGetter, up storage.Unpacker, w io.Write
|
||||
crcSum = make([]byte, 8)
|
||||
multiWriter = io.MultiWriter(w, crcHash)
|
||||
copyBuffer = byteBufferPool.Get().([]byte)
|
||||
// TODO once we have some benchmark or memory profile then we can experiment with using *bytes.Buffer
|
||||
//nolint:staticcheck // SA6002 not going to do a pointer here
|
||||
defer byteBufferPool.Put(copyBuffer)
|
||||
} else {
|
||||
crcHash.Reset()
|
||||
|
Reference in New Issue
Block a user