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

From: Date: Mon, 02 Oct 2000 14:49:48 +0000
Subject: RE: PHP 4.0 Bug #3601 Updated: fgets is NOT binary safe.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-34001@lists.php.net to get a copy of this message
http://php4bug.directoryinfo.net/ -----Original Message----- From: Bug Database [mailto:php-dev@lists.php.net] Sent: Monday, October 02, 2000 10:09 PM To: iredden@redden.on.ca Subject: PHP 4.0 Bug #3601 Updated: fgets is NOT binary safe. ID: 3601 Updated by: sniper Reported By: iredden@redden.on.ca Status: Feedback Bug Type: *General Issues Assigned To: Comments: Reopened. fgets() supports UDP but isn't binary safe. To Ian: Could you provide a working example case? That url didn't work.. --Jani Previous Comments: --------------------------------------------------------------------------- [2000-10-02 22:09:07] sniper@php.net Reopened. fgets() supports UDP but isn't binary safe. To Ian: Could you provide a working example case? That url didn't work.. --Jani --------------------------------------------------------------------------- [2000-10-02 19:05:00] sniper@php.net No feedback. --------------------------------------------------------------------------- [2000-09-04 19:46:02] sniper@php.net 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 --------------------------------------------------------------------------- [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??? --------------------------------------------------------------------------- The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online. Full Bug description available at: http://bugs.php.net/?id=3601

« previous php.dev (#34001) next »