mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-04 01:34:07 +02:00
fixes #62
This commit is contained in:
parent
8d936e04ef
commit
c13231ee18
2 changed files with 5 additions and 5 deletions
|
|
@ -45,9 +45,8 @@ class Connection extends RawConnection {
|
||||||
* @throws ConnectException
|
* @throws ConnectException
|
||||||
*/
|
*/
|
||||||
public function clearTillPrompt(): void {
|
public function clearTillPrompt(): void {
|
||||||
$this->write('');
|
|
||||||
do {
|
do {
|
||||||
$promptLine = $this->readLine();
|
$promptLine = $this->readLine(6);
|
||||||
if ($promptLine === false) {
|
if ($promptLine === false) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +74,7 @@ class Connection extends RawConnection {
|
||||||
if (!$this->isValid()) {
|
if (!$this->isValid()) {
|
||||||
throw new ConnectionException('Connection not valid');
|
throw new ConnectionException('Connection not valid');
|
||||||
}
|
}
|
||||||
$promptLine = $this->readLine(); //first line is prompt
|
$promptLine = $this->readLine(6); //first line is prompt
|
||||||
if ($promptLine === false) {
|
if ($promptLine === false) {
|
||||||
$this->unknownError($promptLine);
|
$this->unknownError($promptLine);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,10 +112,11 @@ class RawConnection {
|
||||||
/**
|
/**
|
||||||
* read a line of output
|
* read a line of output
|
||||||
*
|
*
|
||||||
|
* @param int $length
|
||||||
* @return string|false
|
* @return string|false
|
||||||
*/
|
*/
|
||||||
public function readLine() {
|
public function readLine($length=4086) {
|
||||||
return stream_get_line($this->getOutputStream(), 4086, "\n");
|
return stream_get_line($this->getOutputStream(), $length, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue