PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_WebDAV_Server » Bug #5189

feof($options["stream"]) sometimes return FALSE even after the end of file

Details

Submitted2005-08-23 19:13 UTC
From1111 at own-site dot com
Assignedhholzgra
StatusClosed
PackageHTTP_WebDAV_Server
PHP Version4.3.10
OSLinux
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;
}
}