Skip to content

Overwrite remote share file first downloads it needlessly #17276

Closed

Description

@PVince81

Steps

  1. Setup two OC servers A and B
  2. On A create a folder "local"
  3. Create a file "local/test.txt"
  4. Share "local" with a user on B
  5. Connect to B with WebDAV and PUT a file as "local/test.txt" to overwrite it
  6. Check the access logs on A

Expected result

B PUTs file to A through publicwebdav endpoint

Actual result

Before putting the file, B first does a GET to download the contents of the file from A.
Only then it does a PUT

Versions

ownCloud 8.1 RC2

It looks like it's happening here: https://github.com/owncloud/core/blob/master/lib/private/files/storage/dav.php#L392

From what I understand getCachedFile() was used here in case fopen was done in random access mode. But in the case of full overwrite (mode "w") there is no need to download the remote file.

@icewind1991

Activity

  1. added this to the milestone on Jul 1, 2015
  2. PVince81 commented on Jul 1, 2015

    @PVince81
    ContributorAuthor

    Now I realize this isn't only for s2s, it would also affect WebDAV mounts.

    It seems a similar logic is used for other external storages like SMB (but not all of them)
    This means that external storage upload performance will be reduced.

  3. locked as resolved and limited conversation to collaborators on Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions