ID:               26863
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jim at bluedojo dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         *Directory/Filesystem functions
 Operating System: Windows XP
 PHP Version:      4.3.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip


Previous Comments:
------------------------------------------------------------------------

[2004-01-10 16:56:56] jim at bluedojo dot com

Description:
------------
fgets() hangs infintely on some urls.

This url:  http://www.nwf.org/productions/whales.html

will not do anything and should return false when I use
stream_set_timeout() but it doesn't time out.

I tried fgets($fd, 1024) and fgets($fd, 4096) but that doesn't work
either.

Reproduce code:
---------------
$url = http://www.nwf.org/productions/whales.html;

if ($fd = @fopen($url,'rb')){
   stream_set_timeout($fd, 6);
   $html = '';
   while (!feof($fd)) {
      $html .= trim(fgets($fd));
   }
   
   fclose($fd);
}

Expected result:
----------------
The code should store the html code of "$url" into "$html."  But it
hangs on some urls when it should return false due to
stream_set_timeout();

Actual result:
--------------
fgets() Hangs infinitely.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26863&edit=1

Reply via email to