#26863 [Opn->Fbk]: fgets hangs on some urls

From: Date: Wed, 14 Jan 2004 15:48:57 +0000
Subject: #26863 [Opn->Fbk]: fgets hangs on some urls
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-53313@lists.php.net to get a copy of this message
ID: 26863 Updated by: sniper@php.net Reported By: jim at bluedojo dot com -Status: Open +Status: Feedback Bug Type: *Directory/Filesystem functions Operating System: Windows XP PHP Version: 4CVS-2004-01-10 New Comment: Can you please answer to the question Wez asked in his last comment. Previous Comments: ------------------------------------------------------------------------ [2004-01-12 22:08:56] jim at bluedojo dot com I think removing feof() solved the problem. I don't get any infinite stalls anymore. Thanks. ------------------------------------------------------------------------ [2004-01-10 19:48:26] wez@php.net So the URL needs to return a failure code in order to trigger the problem? Please as specific as you can about it to help us figure out whats happening. ------------------------------------------------------------------------ [2004-01-10 18:06:17] jim at bluedojo dot com The url is now working now so I cannot use it as a test case (it needs to return false). I will see if I can find a new url to test it with the new code. ------------------------------------------------------------------------ [2004-01-10 17:35:18] wez@php.net I suspect the problem to be with feof() rather than fgets(). try this: do { $line = fgets($fp); if ($line === false) break; $html .= trim($line); } while(true); ------------------------------------------------------------------------ [2004-01-10 17:27:29] jim at bluedojo dot com I used the latest snapshot. fgets() still hangs on that specific url and stream_set_timeout does not time out. It should return false but doesn't. ------------------------------------------------------------------------ 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/26863 -- Edit this bug report at http://bugs.php.net/?id=26863&edit=1

« previous php.bugs (#53313) next »