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

getReaderSize() returns wrong size for non regular files #552

Closed
xxorde opened this issue Nov 15, 2016 · 1 comment
Closed

getReaderSize() returns wrong size for non regular files #552

xxorde opened this issue Nov 15, 2016 · 1 comment

Comments

@xxorde
Copy link

xxorde commented Nov 15, 2016

The function getReaderSize(reader io.Reader) (size int64, err error) from api-put-object.go returns the wrong size for non regular files on linux systems.

The problem can be demonstrated with pipes.

cmd := exec.Command("uptime")
stdout, err := cmd.StdoutPipe()
...
n, err := minioClient.PutObject(bucket, filename, stdout, "")

A full demonstration can be found here: https://github.com/xxorde/minio-go-bug

An ugly hotfix can be found here: xxorde@a0e2ffa

Thanks to @harshavardhana and @vadmeste for discussing the problem (https://gitter.im/minio/minio).

@xxorde xxorde changed the title getReaderSize() returns wring size for non regular files getReaderSize() returns wrong size for non regular files Nov 15, 2016
@harshavardhana
Copy link
Member

Fixed by #551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants