#26454 [Opn->Fbk]: feof and fgets hangs out
| From: | wez@php.net | Date: | Sun, 30 Nov 2003 10:35:05 +0000 |
| Subject: | #26454 [Opn->Fbk]: feof and fgets hangs out | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-51377@lists.php.net to get a copy of this message | ||
ID: 26454
Updated by: wez@php.net
Reported By: nunoplopes at sapo dot pt
-Status: Open
+Status: Feedback
Bug Type: Sockets related
Operating System: Windows XP - Apache
PHP Version: 4CVS-2003-11-30
Assigned To: wez
New Comment:
I don't have intimate knowledge of the cvs pserver protocol... why
should it return false instead of timeout?
Previous Comments:
------------------------------------------------------------------------
[2003-11-30 05:26:00] nunoplopes at sapo dot pt
The first example I wrote (in reproduce code) is a good example.
I echo fgets 3 times and it times out in the third fgets. Instead of
timing ou, it should return FALSE.
------------------------------------------------------------------------
[2003-11-30 05:22:46] wez@php.net
Please, just a single script, and please explain what happens and why
it is wrong.
------------------------------------------------------------------------
[2003-11-30 05:14:18] nunoplopes at sapo dot pt
I've compiled a couple of tests and its results on my pc, using the
snapshot of Nov 30, 2003 09:30 GMT.
The tests andits results are at:
http://testes.aborla.net/php-bugreport.tar.bz2
------------------------------------------------------------------------
[2003-11-30 04:33:06] wez@php.net
Can you clarify what is happening now (with the updated snapshot)?
Provide a short script and explain what happens and why you think it is
wrong.
Thanks!
------------------------------------------------------------------------
[2003-11-29 14:59:41] nunoplopes at sapo dot pt
I've installed the new snapshot (Nov 29, 2003 17:30 GMT).
The script still times out. The example I wrote before still doesn't
work, but there is other with feof that works. Really strange....
Working script:
<?
$fp = fsockopen ("pt.php.net", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.1\r\n");
fputs ($fp, "Host: pt.php.net\r\n");
fputs ($fp, "Connection: Close\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/26454
--
Edit this bug report at http://bugs.php.net/?id=26454&edit=1