#18731 [Opn->Bgs]: fputs( $sock, $str0 ). $str0 needs to have '\n' to work properly.
ID: 18731
Updated by: sniper@php.net
Reported By: tondur@ozemail.com.au
-Status: Open
+Status: Bogus
Bug Type: Sockets related
Operating System: Win2k/Winnt v4sp6
PHP Version: 4.2.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2002-08-04 07:46:26] tondur@ozemail.com.au
<?php
$fp = fsockopen ("www.example.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp,
"GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>
This will work but if fputs( ) is this
fputs ($fp, "GET / HTTP/1.0\r\nHost: www.example.com");
ie no "\r\n\r\n", then fgets( ) will block and the code will timeout.
On the server side, the "GET / ..." is read, but will block on the
send( ).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18731&edit=1
Thread (2 messages)