Skip to content

Commit

Permalink
fix EOF case.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritone committed Mar 28, 2024
1 parent 45d0180 commit 202c9c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1552,12 +1552,12 @@ func (r *gRPCReader) Read(p []byte) (int, error) {
// io.WriterTo.
func (r *gRPCReader) WriteTo(w io.Writer) (int64, error) {
// The entire object has been read by this reader, check the checksum if
// necessary and return EOF.
// necessary and return nil.
if r.size == r.seen || r.zeroRange {
if err := r.runCRCCheck(); err != nil {
return 0, err
}
return 0, io.EOF
return 0, nil
}

// No stream to read from, either never initialized or Close was called.
Expand Down

0 comments on commit 202c9c0

Please sign in to comment.