mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
handle exceptions during stream close
This commit is contained in:
parent
b48dfc0927
commit
b2a62743cf
2 changed files with 12 additions and 3 deletions
|
|
@ -61,7 +61,11 @@ class NativeStream implements File {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function stream_close() {
|
public function stream_close() {
|
||||||
return $this->state->close($this->handle);
|
try {
|
||||||
|
return $this->state->close($this->handle);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function stream_eof() {
|
public function stream_eof() {
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,13 @@ class NativeWriteStream extends NativeStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function stream_close() {
|
public function stream_close() {
|
||||||
$this->flushWrite();
|
try {
|
||||||
return parent::stream_close();
|
$this->flushWrite();
|
||||||
|
$flushResult = true;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$flushResult = false;
|
||||||
|
}
|
||||||
|
return parent::stream_close() && $flushResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function stream_tell() {
|
public function stream_tell() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue