apps/dav/lib/Upload/AssemblyStream.php 1 location
|
@@ 125-131 (lines=7) @@
|
| 122 |
|
|
| 123 |
|
$data = fread($this->currentStream, $count); |
| 124 |
|
// isset is faster than strlen |
| 125 |
|
if (isset($data[$count - 1])) { |
| 126 |
|
// we read the full count |
| 127 |
|
$read = $count; |
| 128 |
|
} else { |
| 129 |
|
// reaching end of stream, which happens less often so strlen is ok |
| 130 |
|
$read = strlen($data); |
| 131 |
|
} |
| 132 |
|
|
| 133 |
|
if (feof($this->currentStream)) { |
| 134 |
|
fclose($this->currentStream); |
apps/dav/lib/Upload/AssemblyStreamZsync.php 1 location
|
@@ 120-126 (lines=7) @@
|
| 117 |
|
|
| 118 |
|
// read the data |
| 119 |
|
$data = fread($this->currentStream, $count); |
| 120 |
|
if (isset($data[$count - 1])) { |
| 121 |
|
// we read the full count |
| 122 |
|
$read = $count; |
| 123 |
|
} else { |
| 124 |
|
// reaching end of stream, which happens less often so strlen is ok |
| 125 |
|
$read = strlen($data); |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
// update position |
| 129 |
|
$this->pos += $read; |