Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis authored and icewind1991 committed Oct 28, 2021
1 parent 8d936e0 commit c13231e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Wrapped/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ public function write(string $input) {
* @throws ConnectException
*/
public function clearTillPrompt(): void {
$this->write('');
do {
$promptLine = $this->readLine();
$promptLine = $this->readLine(6);
if ($promptLine === false) {
break;
}
Expand Down Expand Up @@ -75,7 +74,7 @@ public function read(callable $callback = null): array {
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);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Wrapped/RawConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ public function write(string $input) {
/**
* 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");
}

/**
Expand Down

0 comments on commit c13231e

Please sign in to comment.