mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-09 01:26:32 +02:00
Fix memory bug with stream_copy_to_stream (#206)
This commit is contained in:
@@ -1361,7 +1361,10 @@ f00bar;
|
|||||||
$file_stream = fopen($options['file'], 'rb');
|
$file_stream = fopen($options['file'], 'rb');
|
||||||
$stdout_stream = fopen('php://output', 'wb');
|
$stdout_stream = fopen('php://output', 'wb');
|
||||||
|
|
||||||
stream_copy_to_stream($file_stream, $stdout_stream);
|
$buffer_size = 64 * 1024 * 1024; // 64K should be decent for a network stream
|
||||||
|
while (!feof($file_stream)) {
|
||||||
|
fwrite($stdout_stream, fread($file_stream, $buffer_size));
|
||||||
|
}
|
||||||
|
|
||||||
fclose($file_stream);
|
fclose($file_stream);
|
||||||
fclose($stdout_stream);
|
fclose($stdout_stream);
|
||||||
|
Reference in New Issue
Block a user