From f97601525ecdc0bcf735cdcbd974df0b59879225 Mon Sep 17 00:00:00 2001 From: Julien Liabeuf Date: Thu, 9 Apr 2015 00:42:32 +0700 Subject: [PATCH] Fix infinite loop issue with non-closed connections --- fMailbox.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fMailbox.php b/fMailbox.php index 7ccf4e42..e6daacf1 100644 --- a/fMailbox.php +++ b/fMailbox.php @@ -1406,7 +1406,7 @@ private function read($expect=NULL) } if ($select) { - while (!feof($this->connection)) { + do { $line = fgets($this->connection); if ($line === FALSE) { break; @@ -1433,7 +1433,7 @@ private function read($expect=NULL) break; } } - } + } while (!feof($this->connection)); } if (fCore::getDebug($this->debug)) { fCore::debug("Received:\n" . join("\r\n", $response), $this->debug);