Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46997 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96469 invoked from network); 17 Feb 2010 16:15:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2010 16:15:42 -0000 Authentication-Results: pb1.pair.com header.from=mark@hell.ne.jp; sender-id=fail Authentication-Results: pb1.pair.com smtp.mail=mark@hell.ne.jp; spf=fail; sender-id=fail Received-SPF: fail (pb1.pair.com: domain hell.ne.jp does not designate 88.191.88.38 as permitted sender) X-PHP-List-Original-Sender: mark@hell.ne.jp X-Host-Fingerprint: 88.191.88.38 lamune.ookoo.org Linux 2.6 Received: from [88.191.88.38] ([88.191.88.38:54883] helo=Lamune.ookoo.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/FF-11740-A261C7B4 for ; Wed, 17 Feb 2010 11:15:42 -0500 Received: (PMaild MTA 350634 on Lamune.ookoo.org processing mail to pair1.php.net); Wed, 17 Feb 2010 16:15:42 +0000 Received: (PMaild 350615 invoked for remote email internals@lists.php.net); Wed, 17 Feb 2010 16:15:34 +0000 Received: from [192.168.0.25] (p4131-ipbf1501marunouchi.tokyo.ocn.ne.jp [124.102.3.131]) by Lamune.ookoo.org (pMaild); Wed, 17 Feb 2010 16:15:32 +0000 Received: SMTP authenticated user logged in; a2FycGVsZXNAb29rb28ub3Jn; Wed, 17 Feb 2010 16:15:32 +0000 To: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Date: Thu, 18 Feb 2010 01:15:29 +0900 Message-ID: <1266423329.11885.521.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 Content-Transfer-Encoding: 7bit Subject: PATCH: Bug #51056 fread() on blocking stream will block even if data is available From: mark@hell.ne.jp (Mark Karpeles) 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