This commit is contained in:
raffis 2019-03-28 14:41:23 +01:00 committed by Robin Appelman
commit c13231ee18
2 changed files with 5 additions and 5 deletions

View file

@ -45,9 +45,8 @@ class Connection extends RawConnection {
* @throws ConnectException
*/
public function clearTillPrompt(): void {
$this->write('');
do {
$promptLine = $this->readLine();
$promptLine = $this->readLine(6);
if ($promptLine === false) {
break;
}
@ -75,7 +74,7 @@ class Connection extends RawConnection {
if (!$this->isValid()) {
throw new ConnectionException('Connection not valid');
}
$promptLine = $this->readLine(); //first line is prompt
$promptLine = $this->readLine(6); //first line is prompt
if ($promptLine === false) {
$this->unknownError($promptLine);
}

View file

@ -112,10 +112,11 @@ class RawConnection {
/**
* read a line of output
*
* @param int $length
* @return string|false
*/
public function readLine() {
return stream_get_line($this->getOutputStream(), 4086, "\n");
public function readLine($length=4086) {
return stream_get_line($this->getOutputStream(), $length, "\n");
}
/**