From 96546f3fcb8acbea9c0f8afe7713f4db77063460 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 31 Oct 2025 18:37:30 -0700 Subject: [PATCH] simplify --- weed/s3api/chunked_reader_v4.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/weed/s3api/chunked_reader_v4.go b/weed/s3api/chunked_reader_v4.go index f8f7a3ab3..1b4cf05f3 100644 --- a/weed/s3api/chunked_reader_v4.go +++ b/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 cr.chunkSignature != "" { cr.state = verifyChunk - continue } else if cr.lastChunk { cr.state = readTrailerChunk - continue } else { cr.state = readChunkHeader - continue } + continue case readTrailerChunk: // 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() if cr.lastChunk { cr.state = eofChunk - continue } else { cr.state = readChunkHeader - continue } + continue case eofChunk: return n, io.EOF }