• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/smtp.php
  • Класс: BitrixMailSmtp
  • Вызов: Smtp::readLine
protected function readLine()
{
	$line = '';

	while (!feof($this->stream))
	{
		$buffer = @fgets($this->stream, 4096);
		if ($buffer === false)
		{
			break;
		}

		$meta = ($this->options['timeout'] > 0 ? stream_get_meta_data($this->stream) : array('timed_out' => false));

		$line .= $buffer;

		if (preg_match('/rn$/', $buffer, $matches) || $meta['timed_out'])
		{
			break;
		}
	}

	if (!preg_match('/rn$/', $line, $matches))
	{
		$this->reset();

		return false;
	}

	return $line;
}