Skip to content

Commit

Permalink
getReaderSize() returns -1 in case of read/write os.Pipe() stream (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
vadmeste authored and harshavardhana committed Nov 15, 2016
1 parent 9e35cc5 commit 675b291
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions api-put-object.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ func getReaderSize(reader io.Reader) (size int64, err error) {
// implement Seekable calls. Ignore them and treat
// them like a stream with unknown length.
switch st.Name() {
case "stdin":
fallthrough
case "stdout":
fallthrough
case "stderr":
case "stdin", "stdout", "stderr":
return
// Ignore read/write stream of os.Pipe() which have unknown length too.
case "|0", "|1":
return
}
size = st.Size()
Expand Down

0 comments on commit 675b291

Please sign in to comment.