mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
fix support for smbclient compiled without readline support
This commit is contained in:
parent
9f6b8f1c3f
commit
a8dc9ca75b
6 changed files with 60 additions and 43 deletions
|
|
@ -65,16 +65,20 @@ class NotifyHandler implements INotifyHandler {
|
|||
*/
|
||||
public function listen(callable $callback): void {
|
||||
if ($this->listening) {
|
||||
$this->connection->read(function (string $line) use ($callback): bool {
|
||||
while (true) {
|
||||
$line = $this->connection->readLine();
|
||||
if ($line === false) {
|
||||
break;
|
||||
}
|
||||
$this->checkForError($line);
|
||||
$change = $this->parseChangeLine($line);
|
||||
if ($change) {
|
||||
$result = $callback($change);
|
||||
return $result === false ? false : true;
|
||||
} else {
|
||||
return true;
|
||||
if ($result === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue