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
Fix oc stream seek #11204
Fix oc stream seek #11204
Conversation
@butonic Thanks. I will test this tomorrow. |
🚀 Test Passed. 🚀 |
@@ -48,7 +48,10 @@ public function stream_open($path, $mode, $options, &$opened_path) { | |||
} | |||
|
|||
public function stream_seek($offset, $whence = SEEK_SET) { | |||
fseek($this->fileSource, $offset, $whence); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fseek(...) === 0;
Works 👍 |
@fossxplorer @lseabra Check this out. This fixed the memory allocation issue in the music app for the files I got from you. Sidenote: I collected problematic files and checked them with this PR and all problems with the memory allocation are gone. |
@karlitschek I would also vote for the backport. |
01e61bf
to
b752cb9
Compare
A new inspection was created. |
@icewind1991 I updated all wrappers to use the same === comparison |
👍 |
Still 👍 |
👍 very coool. Please backport |
🚀 Test PASSed. 🚀 |
The changes did allow me to scan my music folder, thanks guys! |
I was debugging a strange bug for fun in my vacation: owncloud/music#212
In short fseek end ftell are broken when using the OC stream wrapper. The stream_seek implementation needs to return true or false, depending on the result of fseek, see http://de1.php.net/manual/de/streamwrapper.stream-seek.php#115111
test in ef6db5e
fix in 01e61bf
cc @icewind1991 @MorrisJobke
@karlitschek I recommend backporting unless we want to hunt obscure problems in the enterprise edition