diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-07-03 17:37:20 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-07-03 17:37:20 +0000 |
| commit | 3901e788053bf303cb23eb32bed03b9bcbcd1c63 (patch) | |
| tree | 66754f8cc15fe508f71aa63a9caff7d2aa486ea9 /roundcubemail/program/lib | |
| parent | fe61a8e6265d8e4d800c61657c9eda214f5cff81 (diff) | |
Applied socket error patch by Thomas Mangin
git-svn-id: https://svn.roundcube.net/trunk@639 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/lib')
| -rw-r--r-- | roundcubemail/program/lib/imap.inc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index 6bc47a198..05b1c00e1 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -48,6 +48,7 @@ - Also acceppt LIST responses in iil_C_ListSubscribed() - Sanity check of $message_set in iil_C_FetchHeaders(), iil_C_FetchHeaderIndex(), iil_C_FetchThreadHeaders() - Implemented UID FETCH in iil_C_FetchHeaders() + - Abort do-loop on socket errors (fgets returns false) - Removed some debuggers (echo ...) ********************************************************/ @@ -130,6 +131,8 @@ function iil_ReadLine($fp, $size){ if ($fp){ do{ $buffer = fgets($fp, 2048); + if ($buffer === false) + break; $line.=$buffer; }while($buffer[strlen($buffer)-1]!="\n"); } @@ -229,9 +232,11 @@ function iil_C_Login(&$conn, $user, $password){ $password = strtr($password, array('"'=>'\\"', '\\' => '\\\\')); fputs($conn->fp, "a001 LOGIN $user \"$password\"\r\n"); - do{ - $line = iil_ReadReply($conn->fp); - }while(!iil_StartsWith($line, "a001 ")); + do{ + $line = iil_ReadReply($conn->fp); + if ($line === false) + break; + }while(!iil_StartsWith($line, "a001 ")); $a=explode(" ", $line); if (strcmp($a[1],"OK")==0){ $result=$conn->fp; |
