pcloud: return an early error when Put is called with an unknown size

This stops the 10 minute pause in the integration tests
This commit is contained in:
Nick Craig-Wood 2021-09-17 10:04:19 +01:00
parent c718fe4330
commit 9c2533821d
1 changed files with 4 additions and 0 deletions

View File

@ -1099,6 +1099,10 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
modTime := src.ModTime(ctx)
remote := o.Remote()
if size < 0 {
return errors.New("can't upload unknown sizes objects")
}
// Create the directory for the object if it doesn't exist
leaf, directoryID, err := o.fs.dirCache.FindPath(ctx, remote, true)
if err != nil {