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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 36 - 33 = ?

 
 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-03-28 16:23 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2008-03-25 13:12 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!