Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.8.3

Request #9836 fread() in _read function malfunctioning
Submitted: 2007-01-15 11:46 UTC
From: consensus at gmail dot com Assigned:
Status: No Feedback Package: Cache_Lite (version 1.7.2)
PHP Version: 5.1.2 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2007-01-15 11:46 UTC] consensus at gmail dot com (consensus)
Description: ------------ Hi, I've been debugging in for a few hours to hunt my problem down to a buggy @fread() result. The problem is that the save() call returns false because of the hash value check after storing the file. The problem is within the "function _read()" of Lite.php The filesize() function returns the correct size (about 150kb) But fread($fp,$length); // note that $length is verified to be correct! returns only 16kb of data (-32 bytes of the previous call..) I know it's weird, but it's a fact here. A small testscript which does an fopen,fread,fclose worked fine so it is somehow related to Cache_Lite, or some command cache lite executed within initialization. I solved the Problem by using a loop while ($fp) {} appending 2kb chunks of data from the local file. This way the file is loaded correctly. I suggest to alter this part of Cache_Lite, it should have a very tiny performance impact and will ensure the stability of Cache_Lite in all applications and php versions. best regards

Comments

 [2007-03-26 22:18 UTC] demrit (Miguel Vazquez Gocobachi)
Hi, can you submit your current patch? So I will check them and do some hacks. Thanks
 [2007-03-28 16:23 UTC] fab (Fabien MARTY)
There are some bugfixes in the CVS version because of : http://pear.php.net/bugs/bug.php?id=8361 Can you try the CVS version ?
 [2008-03-25 13:12 UTC] tacker (Markus Tacker)
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.