Browse Source

simplify

pull/7421/head
chrislu 1 month ago
parent
commit
96546f3fcb
  1. 7
      weed/s3api/chunked_reader_v4.go

7
weed/s3api/chunked_reader_v4.go

@ -284,14 +284,12 @@ func (cr *s3ChunkedReader) Read(buf []byte) (n int, err error) {
// If we're using unsigned streaming upload, there is no signature to verify at each chunk. // If we're using unsigned streaming upload, there is no signature to verify at each chunk.
if cr.chunkSignature != "" { if cr.chunkSignature != "" {
cr.state = verifyChunk cr.state = verifyChunk
continue
} else if cr.lastChunk { } else if cr.lastChunk {
cr.state = readTrailerChunk cr.state = readTrailerChunk
continue
} else { } else {
cr.state = readChunkHeader cr.state = readChunkHeader
continue
} }
continue
case readTrailerChunk: case readTrailerChunk:
// When using unsigned upload, this would be the raw contents of the trailer chunk: // When using unsigned upload, this would be the raw contents of the trailer chunk:
@ -409,11 +407,10 @@ func (cr *s3ChunkedReader) Read(buf []byte) (n int, err error) {
cr.chunkSHA256Writer.Reset() cr.chunkSHA256Writer.Reset()
if cr.lastChunk { if cr.lastChunk {
cr.state = eofChunk cr.state = eofChunk
continue
} else { } else {
cr.state = readChunkHeader cr.state = readChunkHeader
continue
} }
continue
case eofChunk: case eofChunk:
return n, io.EOF return n, io.EOF
} }

Loading…
Cancel
Save