|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-26 20:16 UTC] miniman dot k3o at gmail dot com
[2007-11-27 13:02 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 22:00:01 2025 UTC |
Description: ------------ cyte from php.net/socket_read : Return Values Note: socket_read() returns a zero length string ("") when there is no more data to read. // Ive downloaded today PHP 5.2.5 sources from php.net site. Compiled it. Start my server and saw that it: returns FALSE on 'NO MORE DATA TO READ' // I think it is a bug; Reproduce code: --------------- php-5.2.5/ext/sockets isn't it a patch ? --- sockets.c 2007-09-26 12:55:07.000000000 +0200 +++ sockets.c.fixed 2007-11-26 19:51:23.000000000 +0100 @@ -891,6 +891,10 @@ ) { php_sock->error = errno; SOCKETS_G(last_error) = errno; + /*minicode starts: return empty string bugfix*/ + efree(tmpbuf); + RETURN_STRINGL('\0',0,0); + /*minicode ends*/ } else { PHP_SOCKET_ERROR(php_sock, "unable to read from socket", errno); }