download: do not read excess (fix #592)
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/602/head
parent
da192ee70e
commit
35754c36fa
|
@ -206,7 +206,8 @@ class DownloadController extends GenericApiController
|
|||
ob_start();
|
||||
|
||||
while (!feof($res) && $seekStart <= $seekEnd) {
|
||||
$buffer = fread($res, 1024 * 1024);
|
||||
$lenLeft = $seekEnd - $seekStart + 1;
|
||||
$buffer = fread($res, min(1024 * 1024, $lenLeft));
|
||||
if (false === $buffer) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue