PHP 4.0 Bug #3601: fgets is NOT binary safe.

From: Date: Thu, 24 Feb 2000 04:10:39 +0000
Subject: PHP 4.0 Bug #3601: fgets is NOT binary safe.
Groups: php.dev 
Request: Send a blank email to php-dev+get-15924@lists.php.net to get a copy of this message
From: iredden@redden.on.ca Operating system: Redhat 6.1 Linux PHP version: 4.0 Beta 4 Patch Level 1 PHP Bug Type: Other Bug description: fgets is NOT binary safe. I am using a UDP socket routine. fgets does not seem to be binary safe and you cant seem to use fread or fwrite which are two commands which are binary safe. <?php $maxlen = 1024; $default_host = "128.143.204.90"; $default_port = "28001"; $connection = fsockopen("udp://".$default_host, $default_port, &$errno, &$errstr, 5); if(!$connection) { echo "$errstr ($errno)<br>\n"; } else { $msgsend = "bah"; fputs($connection, $msgsend); $msgrecv = fgets($connection, $maxlen); } echo $msgrecv; fclose($connection); ?> goto http://www.clanhosting.net/packet.doc for the packet query and response packet formats to test my demo. I have played with this for hours and it just doesnt seem to be binary safe. Am I doing something wrong???

« previous php.dev (#15924) next »