mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixing MediaView so it will stop reading file when connection is aborted.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7642 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
fafb01b09d
commit
8b45eeed8b
1 changed files with 2 additions and 6 deletions
|
@ -80,7 +80,6 @@ class MediaView extends View {
|
|||
'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh',
|
||||
'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml',
|
||||
'mime' => 'www/mime', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-pdb');
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -89,7 +88,6 @@ class MediaView extends View {
|
|||
function __construct(&$controller) {
|
||||
parent::__construct($controller);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
|
@ -179,7 +177,7 @@ class MediaView extends View {
|
|||
}
|
||||
@ob_end_clean();
|
||||
|
||||
while (!feof($handle) && connection_status() == 0) {
|
||||
while (!feof($handle) && connection_status() == 0 && !connection_aborted()) {
|
||||
set_time_limit(0);
|
||||
$buffer = fread($handle, $chunkSize);
|
||||
echo $buffer;
|
||||
|
@ -187,9 +185,7 @@ class MediaView extends View {
|
|||
@ob_flush();
|
||||
}
|
||||
fclose($handle);
|
||||
if (connection_status() == 0 && !connection_aborted()) {
|
||||
return;
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue