ID: 43417
User updated by: miniman dot k3o at gmail dot com
-Summary: socket_read
Reported By: miniman dot k3o at gmail dot com
Status: Open
Bug Type: Sockets related
Operating System: Linux Slackware
PHP Version: 5.2.5
New Comment:
changed summary
Previous Comments:
------------------------------------------------------------------------
[2007-11-26 20:06:19] miniman dot k3o at gmail dot com
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);
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43417&edit=1