#43417 [NEW]: socket_read

From: Date: Mon, 26 Nov 2007 20:06:20 +0000
Subject: #43417 [NEW]: socket_read
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120101@lists.php.net to get a copy of this message
From: miniman dot k3o at gmail dot com Operating system: Linux Slackware PHP version: 5.2.5 PHP Bug Type: Sockets related Bug description: socket_read 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 bug report at http://bugs.php.net/?id=43417&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43417&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43417&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43417&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43417&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43417&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43417&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43417&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43417&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43417&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43417&r=support Expected behavior: http://bugs.php.net/fix.php?id=43417&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43417&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43417&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43417&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43417&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43417&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43417&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43417&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43417&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43417&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43417&r=mysqlcfg

« previous php.bugs (#120101) next »