PHP 4.0 Bug #7862: On a network connection fgetc hangs when NULL bytes get involved

From: Date: Fri, 17 Nov 2000 10:41:50 +0000
Subject: PHP 4.0 Bug #7862: On a network connection fgetc hangs when NULL bytes get involved
Groups: php.dev 
Request: Send a blank email to php-dev+get-38401@lists.php.net to get a copy of this message
From: burwitz@mails-media.de Operating system: SuSE Linux 6.3 PHP version: 4.0.3pl1 PHP Bug Type: Filesystem function related Bug description: On a network connection fgetc hangs when NULL bytes get involved I have the following problem: $fp =fsockopen($server, 8611, &$errno, &$errstr); while(feof($fp)!=true) { echo "X"; # for debuging flush(); # for debuging fflush($fp); # for debuging $str.=fgetc($fp); # or fgets($fp,2); or fread($fp,1); echo "Y"; # for debuging flush(); # for debuging fflush($fp); # for debuging } # while Would produce "XYXYXYXYXYXYX" When the received data looks like "%00%0A%00%00%00%00%00%00" in HEX. That means at the last character which is a NULL-byte the fgetc or fgets or fread would hang! BUT fread($fp,8); works! But I need it for variable length as well! Thanks for the help -- Edit Bug report at: http://bugs.php.net/?id=7862&edit=1

« previous php.dev (#38401) next »