Skip to content

Commit

Permalink
If connection is aborted, now MediaView returns false after stopping …
Browse files Browse the repository at this point in the history
…the transfer
  • Loading branch information
lorenzo committed Apr 13, 2010
1 parent 940ce8b commit 0300fc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cake/libs/view/media.php
Expand Up @@ -208,7 +208,11 @@ function render() {
$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;
Expand Down Expand Up @@ -253,7 +257,7 @@ function _output() {
}

/**
* Returns true if connectios is still active
* Returns true if connection is still active
* @return boolean
* @access protected
*/
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/view/media.test.php
Expand Up @@ -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
Expand Down

0 comments on commit 0300fc1

Please sign in to comment.