X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/737f7d618ffc18152c5d09416884910bd180d890..dd481ab3359f1b360a22d03c09d8035ef5db1f38:/services/keep-web/webdav.go diff --git a/services/keep-web/webdav.go b/services/keep-web/webdav.go index 98e6f01987..432c6af6d8 100644 --- a/services/keep-web/webdav.go +++ b/services/keep-web/webdav.go @@ -38,11 +38,16 @@ var ( type webdavFS struct { collfs arvados.CollectionFileSystem writing bool - reading bool + // webdav PROPFIND reads the first few bytes of each file + // whose filename extension isn't recognized, which is + // prohibitively expensive: we end up fetching multiple 64MiB + // blocks. Avoid this by returning EOF on all reads when + // handling a PROPFIND. + alwaysReadEOF bool } func (fs *webdavFS) makeparents(name string) { - dir, name := path.Split(name) + dir, _ := path.Split(name) if dir == "" || dir == "/" { return } @@ -73,13 +78,7 @@ func (fs *webdavFS) OpenFile(ctx context.Context, name string, flag int, perm os // have 405. f = writeFailer{File: f, err: errReadOnly} } - if !fs.reading { - // webdav PROPFIND reads the first few bytes of each - // file whose filename extension isn't recognized, - // which is prohibitively expensive: we end up - // fetching multiple 64MiB blocks. Avoid this by - // returning EOF on all reads when handling a - // PROPFIND. + if fs.alwaysReadEOF { f = readEOF{File: f} } return