Skip to content

Commit

Permalink
Use feof() in while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
RichieB2B authored and markstory committed Mar 24, 2015
1 parent 3995c70 commit 7704efd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Network/CakeSocket.php
Expand Up @@ -177,9 +177,9 @@ public function connect() {
$req[] = 'Host: ' . $this->config['host'];
$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));
if (preg_match('/^$/', $s)) {
break;
Expand Down

0 comments on commit 7704efd

Please sign in to comment.