Permalink
Browse files

If connection is aborted, now MediaView returns false after stopping …

…the transfer
  • Loading branch information...
1 parent 940ce8b commit 0300fc1c31634afcd327484978b9b30eb6ba8838 @lorenzo lorenzo committed Apr 13, 2010
Showing with 7 additions and 3 deletions.
  1. +6 −2 cake/libs/view/media.php
  2. +1 −1 cake/tests/cases/libs/view/media.test.php
@@ -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;
@@ -253,7 +257,7 @@ function _output() {
}
/**
- * 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

0 comments on commit 0300fc1

Please sign in to comment.