Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrite remote share file first downloads it needlessly #17276

Closed
PVince81 opened this issue Jul 1, 2015 · 1 comment · Fixed by #17347
Closed

Overwrite remote share file first downloads it needlessly #17276

PVince81 opened this issue Jul 1, 2015 · 1 comment · Fixed by #17347

Comments

@PVince81
Copy link
Contributor

PVince81 commented Jul 1, 2015

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

@PVince81
Copy link
Contributor Author

PVince81 commented Jul 1, 2015

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants