PATCH: Bug #51056 fread() on blocking stream will block even if data is available
| From: | Mark Karpeles | Date: | Wed, 17 Feb 2010 16:15:29 +0000 |
| Subject: | PATCH: Bug #51056 fread() on blocking stream will block even if data is available | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-46997@lists.php.net to get a copy of this message | ||
Hi,
Got some troubles since a long time ago with fread() on blocking
streams, and found a bug with fread() when reading a blocking stream
with a buffer too small to contain all the received data.
http://bugs.php.net/bug.php?id=51056
I've made a patch on PHP_5_3, and wish to hear about it (and if it's
good, wish to see it applied).
http://ookoo.org/svn/snip/php-PHP_5_3-streams-socket-blocking-nostuck.patch
The change should be pretty much the same for PHP_5_2 (which exhibits
the same bug).
Test script is available in the bug report to see that the fix is indeed
effective.
Mark