Use feof() in while loop

This commit is contained in:
Richard van den Berg 2015-03-19 09:03:26 +01:00 committed by mark_story
parent 3995c70046
commit 7704efdb28

View file

@ -177,9 +177,9 @@ class CakeSocket {
$req[] = 'Host: ' . $this->config['host']; $req[] = 'Host: ' . $this->config['host'];
$req[] = 'User-Agent: php proxy'; $req[] = 'User-Agent: php proxy';
fwrite($this->connection, implode("\r\n", $req)."\r\n\r\n"); fwrite($this->connection, implode("\r\n", $req) . "\r\n\r\n");
while(true) { while (!feof($this->connection)) {
$s = rtrim(fgets($this->connection, 4096)); $s = rtrim(fgets($this->connection, 4096));
if (preg_match('/^$/', $s)) { if (preg_match('/^$/', $s)) {
break; break;