ID: 21760
Comment by: hobbit_be at yahoo dot com
Reported By: sunday at csh dot rit dot edu
Status: No Feedback
Bug Type: Sockets related
Operating System: FreeBSD 4.7
PHP Version: 4.3.0
New Comment:
same problem here (July 29, 2003) PHP 4.3.1.
however i do not get an endless \n - i simply search for my end char
(using strpos) and return all before it. Works a charm.
W2K pro, Apache (1.3.6 and 2.0.?).
while (($buf = @socket_read ($socket, 2048 ))!== false)
{
$data .= $buf;
$pos = strpos($data, "\0");
if($pos != -1 )
{
echo "Found NULL Char ";
echo $data;
echo " pos: $pos";
break;
}
echo $data;
}
Previous Comments:
------------------------------------------------------------------------
[2003-07-08 15:58:55] jason at superlink dot net
Does anyone even read this? It's been sitting here for about 7 months
now with no resolution in sight.
------------------------------------------------------------------------
[2003-07-03 04:34:28] johan at piri dot nu
I am experiencing this problem too. And it seems that is has not been
fixed with PHP 5.0.0b1.
------------------------------------------------------------------------
[2003-06-29 06:43:49] jason at superlink dot net
Bug is on 4.3.2 on redhat too.
------------------------------------------------------------------------
[2003-06-17 11:53:13] zstealer at nospam dot msn dot com
Im having a similar problem, Im working on an IRC bot, Im using the
latest stable version for windows, (4.3.3 i think) and Windows XP
professional with all the latest updates.
Obviously, when i do socket_read with PHP_NORMAL_READ, it returns
nothing, but PHP_BINARY_READ works fine.
Please fix this, I have been looking for help for a long time, Many
people told me PHP_NORMAL_READ is currently buggy at the moment.
------------------------------------------------------------------------
[2003-06-06 21:55:27] jason at superlink dot net
I have this problem on PHP 4.3.2 with FreeBSD 4.8.
socket_read() will return an infinate amount of "\n" from the socket.
This ends up using a LOT of cpu as you can well imagine.
I had to write a script to kill all php processes when over 40% cpu
usage. (This was before I knew about the infinate \n output).
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/21760
--
Edit this bug report at http://bugs.php.net/?id=21760&edit=1