You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Range request fail with GDrive stream wrapper, stream lies about being seekable #22476
If you debug into that block and evaluate the stream's metadata, its "seekable" value is true.
However as soon as Sabre tries to do a fseek it will fail.
I suspect this might be due to our stream wrappers which do implement fseek. We might need to somehow patch the wrappers to properly forward the underlying stream metadata.
If that doesn't work, then we might want to implement the "read and discard data up to the correct position" to simulate forward fseek. (which Sabre actually does already if we tell it that the stream is not seekable)
AHA, it looks like doing a fopen() on http:// supports fseek, but https:// doesn't...
Create a folder "test" with a file "bacon.txt" inside
Create a link share for "test"
Mount the link share on a local OC 9.0 / master as "test"
curl -X GET -H Range:bytes=2-5 'http://admin:admin@localhost/owncloud/remote.php/webdav/gdrive/bacon.txt' (on the local instance)
Expected: fseek worked, middle of the text returned
Actual: start of the text returned
Activity
PVince81 commentedon Feb 17, 2016
This breaks syncing when the sync client tries to resume downloading using range requests.
PVince81 commentedon Feb 17, 2016
Citing http://php.net/manual/de/function.stream-get-meta-data.php#115608
"Apparently, custom wrappers are always seekable."
But maybe there is a way to influence the metadata ?
PVince81 commentedon Feb 17, 2016
If that doesn't work, then we might want to implement the "read and discard data up to the correct position" to simulate forward fseek. (which Sabre actually does already if we tell it that the stream is not seekable)
PVince81 commentedon Feb 17, 2016
Something to be fixed in the streams library icewind1991/Streams#2
PVince81 commentedon Feb 24, 2016
I did some research and didn't find any way to make the stream wrapper influence the return value of
stream_get_meta_data. So I raised at ticket for Sabre DAV https://github.com/fruux/sabre-dav/issues/787 to revert to the old 2.1 behavior where it was actually checking the result offseekPVince81 commentedon Mar 9, 2016
fseek works for GDrive on OC 9.0.0 because we had to fix the download by adding an intermediary temporary file which is seekable.
However, we still need the general solution for non-seekable stream.
PVince81 commentedon Mar 15, 2016
Note that in 9.0 this isn't an issue any more because of the GDrive workaround using a temporary file.
So before applying the patch, let's find out which external storages support streaming and would suffer from the fseek issue.
I suspect that Webdav/ownCloud external storages (and/or fed shares) might.
PVince81 commentedon Mar 15, 2016
Hmm, with federated shares,
fseekseems to work fine. Weird, it's not supposed to work on network streams.PVince81 commentedon Mar 15, 2016
AHA, it looks like doing a
fopen()onhttp://supports fseek, buthttps://doesn't...PVince81 commentedon Mar 15, 2016
Steps:
curl -X GET -H Range:bytes=2-5 'http://admin:admin@localhost/owncloud/remote.php/webdav/gdrive/bacon.txt'(on the local instance)Expected: fseek worked, middle of the text returned
Actual: start of the text returned
PVince81 commentedon Mar 15, 2016
Fix is here through library update: owncloud-archive/3rdparty#258
guruz commentedon Mar 22, 2016
@atroxix is getting negative content lengths already from PROPFIND.
Is this fixed with that PR too?
owncloud/client#4573 (comment)
PVince81 commentedon Mar 23, 2016
No, negative content length is a different thing.
lock commentedon Aug 5, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.