Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update object Put to avoid loosing last chunk #995

Merged
merged 1 commit into from Jun 9, 2022
Merged

Update object Put to avoid loosing last chunk #995

merged 1 commit into from Jun 9, 2022

Commits on Jun 9, 2022

  1. Update object Put to avoid loosing last chunk

    The old code might miss the last object if `Reader` return both a value and `EOF`
    
    Extract from `Reader` doc :
    > When Read encounters an error or end-of-file condition after successfully reading n > 0 bytes, it returns the number of bytes read. It may return the (non-nil) error from the same call or return the error (and n == 0) from a subsequent call. An instance of this general case is that a Reader returning a non-zero number of bytes at the end of the input stream may return either err == EOF or err == nil. The next Read should return 0, EOF.
    >
    > Callers should always process the n > 0 bytes returned before considering the error err. Doing so correctly handles I/O errors that happen after reading some bytes and also both of the allowed EOF behaviors.
    tinou98 committed Jun 9, 2022
    Copy the full SHA
    9654d96 View commit details
    Browse the repository at this point in the history