mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
optimize get and put
This commit is contained in:
parent
85b101b701
commit
6691355d93
1 changed files with 2 additions and 2 deletions
|
|
@ -174,7 +174,7 @@ class NativeShare extends AbstractShare {
|
||||||
$sourceHandle = fopen($source, 'rb');
|
$sourceHandle = fopen($source, 'rb');
|
||||||
$targetHandle = $this->state->create($this->buildUrl($target));
|
$targetHandle = $this->state->create($this->buildUrl($target));
|
||||||
|
|
||||||
while ($data = fread($sourceHandle, 4096)) {
|
while ($data = fread($sourceHandle, NativeReadStream::CHUNK_SIZE)) {
|
||||||
$this->state->write($targetHandle, $data);
|
$this->state->write($targetHandle, $data);
|
||||||
}
|
}
|
||||||
$this->state->close($targetHandle);
|
$this->state->close($targetHandle);
|
||||||
|
|
@ -214,7 +214,7 @@ class NativeShare extends AbstractShare {
|
||||||
throw new InvalidResourceException('Failed opening remote file "' . $source . '" for reading');
|
throw new InvalidResourceException('Failed opening remote file "' . $source . '" for reading');
|
||||||
}
|
}
|
||||||
|
|
||||||
while ($data = $this->state->read($sourceHandle, 4096)) {
|
while ($data = $this->state->read($sourceHandle, NativeReadStream::CHUNK_SIZE)) {
|
||||||
fwrite($targetHandle, $data);
|
fwrite($targetHandle, $data);
|
||||||
}
|
}
|
||||||
$this->state->close($sourceHandle);
|
$this->state->close($sourceHandle);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue