作者 邓超

优化

... ... @@ -24,7 +24,7 @@ class ImapClient {
/**
* @var int
*/
public int $timeOut = 5;
public int $timeOut = 500;
/**
* 是否是非阻塞模式
... ... @@ -196,9 +196,14 @@ class ImapClient {
while (1){
$line = $this->readLine();
$result[] = $line;
list($token) = explode(' ',$line,2);
$lines = explode(' ',$line,3);
// 坏请求 * bad request
if($lines[0] == '*' && ($lines[1]??'') == 'BAD'){
break;
}
// 结束了
if($token == $tag || $line === false){
if($lines[0] == $tag || $line === false){
break;
}
}
... ...