mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
If connection is aborted, now MediaView returns false after stopping the transfer
This commit is contained in:
parent
940ce8b06e
commit
0300fc1c31
2 changed files with 7 additions and 3 deletions
|
@ -208,7 +208,11 @@ class MediaView extends View {
|
|||
$this->_output();
|
||||
$this->_clearBuffer();
|
||||
|
||||
while (!feof($handle) && $this->_isActive()) {
|
||||
while (!feof($handle)) {
|
||||
if (!$this->_isActive()) {
|
||||
fclose($handle);
|
||||
return false;
|
||||
}
|
||||
set_time_limit(0);
|
||||
$buffer = fread($handle, $chunkSize);
|
||||
echo $buffer;
|
||||
|
@ -253,7 +257,7 @@ class MediaView extends View {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if connectios is still active
|
||||
* Returns true if connection is still active
|
||||
* @return boolean
|
||||
* @access protected
|
||||
*/
|
||||
|
|
|
@ -73,7 +73,7 @@ class TestMediaView extends MediaView {
|
|||
var $headers = array();
|
||||
|
||||
/**
|
||||
* active property to mock the status of a remote conenction
|
||||
* active property to mock the status of a remote connection
|
||||
*
|
||||
* @var boolean true
|
||||
* @access public
|
||||
|
|
Loading…
Reference in a new issue