From 323daae63e28cb375af5a42041a6ac965d14b9c3 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Sat, 19 Aug 2017 12:42:31 +0200 Subject: [PATCH] http: immediately fail streaming uploads instead of spooling them first (see #1614) --- http/http.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/http/http.go b/http/http.go index 13fc21851..442f5be99 100644 --- a/http/http.go +++ b/http/http.go @@ -356,6 +356,11 @@ func (f *Fs) Put(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs. return nil, errorReadOnly } +// PutStream uploads to the remote path with the modTime given of indeterminate size +func (f *Fs) PutStream(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + return nil, errorReadOnly +} + // Fs is the filesystem this remote http file object is located within func (o *Object) Fs() fs.Info { return o.fs @@ -478,7 +483,8 @@ func (o *Object) MimeType() string { // Check the interfaces are satisfied var ( - _ fs.Fs = &Fs{} - _ fs.Object = &Object{} - _ fs.MimeTyper = &Object{} + _ fs.Fs = &Fs{} + _ fs.PutStreamer = &Fs{} + _ fs.Object = &Object{} + _ fs.MimeTyper = &Object{} )