mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #414] cannot partial update using ranges beyond the current file size #225
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fyears on GitHub (Jul 13, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/414
Problem
In this pr dufs supports partial upload from sabre style. But it seems that currently dufs cannot accept ranges beyond the the current file size.
Steps to reproduce:
X-Update-Range: append. Everything is ok, too.X-Update-Range: bytes=3-6, where the start offset is larger than the current uploaded file size. The server returns an error 400.I think the problem may be because that dufs doesn't implement this rule from sabre/dav:
Configuration
Nothing special
Log
Environment:
@sigoden commented on GitHub (Jul 13, 2024):
Can you explain why you need this?
@fyears commented on GitHub (Jul 13, 2024):
For example, I would like to upload a file by chunks in parallel.
If only
appendis supported, I can only upload the chunks one by one in sequences.If ranges beyond file size is supported, I can: create 0 byes file using put, then upload last byte (or chunk) using range (so that the whole file is created on the server), then upload the remaining chunks in parallel.
@sigoden commented on GitHub (Jul 14, 2024):
We will not support partial update using ranges beyond the current file size. Here is the reason:
Dufs is stateless, it cannot implement parallel writing to the same file, Therefore, it cannot implement uploading a file by chunks in parallel.
Too dangerous. A malicious large range value (1000000000000000-1000000000000001) could exhaust your disk resources. Normally, the malicious user need to upload this much data, but now only need 1 byte.
@fyears commented on GitHub (Jul 14, 2024):
OK. But here is another related point:
dufs returns the header
sabredav-partialupdatebut actually doesn't fully support everything in https://sabre.io/dav/http-patch/ . So it may confuse the automated detection of some program like mine.Is there any other special header indicating the server is dufs so that my program and potentially other program can differentiate dufs from other normal sabre/webdav servers? For example, something like
X-DUFS: trueis sufficient.@sigoden commented on GitHub (Jul 14, 2024):
Thanks for your reminder.
@fyears commented on GitHub (Jul 27, 2024):
Ok. May I ask when will the new version be released?
@sigoden commented on GitHub (Jul 27, 2024):
A new version is generally released every 3 months unless there are significant updates. So the next update will have to wait until the end of August.