Bug #79000 [Opn->Csd]: Non-blocking socket stream reports EAGAIN as error

From: Date: Fri, 20 Dec 2019 10:38:08 +0000
Subject: Bug #79000 [Opn->Csd]: Non-blocking socket stream reports EAGAIN as error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224439@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79000&edit=1 ID: 79000 Updated by: nikic@php.net Reported by: nikic@php.net Summary: Non-blocking socket stream reports EAGAIN as error -Status: Open +Status: Closed Type: Bug Package: Streams related PHP Version: 7.4Git-2019-12-19 (Git) Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=10eb0b3110638c65f133c5ccc1cf2303db79e2bb Log: Fixed bug #79000 Previous Comments: ------------------------------------------------------------------------ [2019-12-19 12:29:34] nikic@php.net The following pull request has been associated: Patch Name: Fix bug #79000 On GitHub: https://github.com/php/php-src/pull/5026 Patch: https://github.com/php/php-src/pull/5026.patch ------------------------------------------------------------------------ [2019-12-19 12:20:01] nikic@php.net Description: ------------ EAGAIN/EWOULDBLOCK writes result in a notice for non-blocking socket streams. Since PHP 7.4 additionally false will be returned. Test script: --------------- <?php error_reporting(E_ALL); [$sock1, $sock2] = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP); $str = str_repeat('a', 1000000); stream_set_blocking($sock1, false); var_dump(fwrite($sock1, $str)); var_dump(fwrite($sock1, $str)); Expected result: ---------------- int(196608) int(0) Actual result: -------------- Notice: fwrite(): send of 8192 bytes failed with errno=11 Resource temporarily unavailable in /home/nikic/php-7.4/t246.php on line 6 int(196608) Notice: fwrite(): send of 8192 bytes failed with errno=11 Resource temporarily unavailable in /home/nikic/php-7.4/t246.php on line 7 bool(false) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79000&edit=1

« previous php.bugs (#224439) next »