mega: return error if an unknown length file is attempted to be uploaded

This fixes the integration test created in #2947 to attempt to flush
out non-conforming backends.
This commit is contained in:
Nick Craig-Wood 2019-02-07 10:43:31 +00:00
parent 99c37028ee
commit a0016e00d1

View File

@ -1076,6 +1076,9 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) {
// The new object may have been created if an error is returned
func (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) {
size := src.Size()
if size < 0 {
return errors.New("mega backend can't upload a file of unknown length")
}
//modTime := src.ModTime()
remote := o.Remote()