Home » HTTP » HTTP_WebDAV_Server » Bug #5189
feof($options["stream"]) sometimes return FALSE even after the end of file
Details
| Submitted | 2005-08-23 19:13 UTC |
|---|---|
| From | 1111 at own-site dot com |
| Assigned | hholzgra |
| Status | Closed |
| Package | HTTP_WebDAV_Server |
| PHP Version | 4.3.10 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-08-23 19:13 UTC] 1111 at own-site dot com
Description:
------------
Version 1.0.0rc1
I figured out that filesystem example give me error 403 when i try to store some files. That was because feof function reported FALSE (in http_PUT method) even when end of file was reached and there was empty fread result.
This situation applies not to every file, i figured that this applies to files that are less or equal 4096 bytes.
And everything is fine for file with 4097 bytes.
Test script:
---------------
Here is my patch, it works fine for any file.
while ($buf_ = fread($options["stream"], 4096)) {
if (!fwrite($stream, $buf_)) {
$stat = "403 Forbidden";
break;
}
}