Skip to content

Commit

Permalink
Proof of concept hotfix for getReaderSize()
Browse files Browse the repository at this point in the history
  • Loading branch information
xxorde committed Nov 15, 2016
1 parent 9e35cc5 commit a0e2ffa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api-put-object.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ func getReaderSize(reader io.Reader) (size int64, err error) {
return
}
size = st.Size()
// FileInfo.Size() returns:
// length in bytes for regular files; system-dependent for others
// For other types like pipes it can return 0 instead.
// This is an ugly fix to make pipes work on linux systems.
if size == 0 {
size = -1
}
case *Object:
var st ObjectInfo
st, err = v.Stat()
Expand Down

0 comments on commit a0e2ffa

Please sign in to comment.