Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
perf: avoid getting files size twice
Browse files Browse the repository at this point in the history
Signed-off-by: Domingo Oropeza <doropeza@teclib.com>
  • Loading branch information
DIOHz0r committed Mar 2, 2018
1 parent 2fde273 commit 172bc78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inc/file.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ protected function sendFile() {

// Download range defaults to the full file
// get file metadata
$size = filesize($streamSource);
$size = $this->fields['filesize'];
$begin = 0;
$end = $size - 1;
$mimeType = 'application/octet-stream';
Expand Down
2 changes: 1 addition & 1 deletion inc/package.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ protected function sendFile() {
exit(0);
}

$size = filesize($streamSource);
$size = $this->fields['filesize'];
$begin = 0;
$end = $size - 1;
$mimeType = 'application/octet-stream';
Expand Down

0 comments on commit 172bc78

Please sign in to comment.