Mantis - Quercus
Viewing Issue Advanced Details
3311 block always 01-30-09 18:11 02-03-09 07:09
koreth  
nam  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003311: feof doesn't detect EOF on sockets sometimes
<?php
$context = stream_context_create(array('http' => array(
                'method' => 'GET', 'user_agent' => 'Test Client')));
$sock = fopen('http://api.facebook.com/restserver.php', [^] 'r', false, $context);
$result = '';
if ($sock) {
  while (!feof($sock)) {
    $result .= fgets($sock, 4096);
  }
  fclose($sock);
}
print $result;

Regular PHP prints the XML error message from api.facebook.com. Quercus spins in an infinite loop (apparently feof() is never returning true).

Notes
(0003793)
nam   
02-02-09 15:08   
php/164q
(0003800)
nam   
02-03-09 07:09   
php/164q