PHP 4.0 Bug #3601 Updated: fgets is NOT binary safe.
| From: | Bug Database | Date: | Mon, 04 Sep 2000 23:46:02 +0000 |
| Subject: | PHP 4.0 Bug #3601 Updated: fgets is NOT binary safe. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32000@lists.php.net to get a copy of this message | ||
ID: 3601
Updated by: sniper
Reported By: iredden@redden.on.ca
Status: Feedback
Bug Type: Other
Assigned To:
Comments:
Just tested that example script and it worked..but that url given
doesn't exist so I couldn't test it further.
Stas: I believe UDP-support exists now?
At least manual says so..=)
--Jani
Previous Comments:
[2000-03-03 14:47:51] sas@cvs.php.net
Suspending this until UDP support exists.
---------------------------------------------------------------------------
[2000-02-23 23:10:39] iredden@redden.on.ca
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???
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=3601