title: Why Bitdefender prevent flush data (PHP)?
body: <p>This code print result after each loop to browser.Works on my host and localhost.<br> but after install <code>bitdefender total security 2015</code> on my pc not works(print all text after 10 seconds at once)
  i disable antivirus and firewall in bitdefender but not solved.<br>
  How to solve this?
  Demo: <a href="http://s2.uploadcloud.net/2.php" rel="nofollow">http://s2.uploadcloud.net/2.php</a></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
      &lt;html&gt;
          &lt;head&gt;
              &lt;meta charset="utf-8" /&gt;
  
              &lt;script&gt;
       var es;
  
      function startTask() {
          es = new EventSource('progress.php');
  
          //a message is received
          es.addEventListener('message', function(e) {
              var result = JSON.parse( e.data );
  
              addLog(result.message);       
  
              if(e.lastEventId == 'CLOSE') {
                  addLog('Received CLOSE closing');
                  es.close();
                  var pBar = document.getElementById('progressor');
                  pBar.value = pBar.max; //max out the progress bar
              }
              else {
                  var pBar = document.getElementById('progressor');
                  pBar.value = result.progress;
                  var perc = document.getElementById('percentage');
                  perc.innerHTML   = result.progress  + "%";
                  perc.style.width = (Math.floor(pBar.clientWidth * (result.progress/100)) + 15) + 'px';
              }
          });
  
          es.addEventListener('error', function(e) {
              addLog('Error occurred');
              es.close();
          });
      }
  
      function stopTask() {
          es.close();
          addLog('Interrupted');
      }
  
      function addLog(message) {
          var r = document.getElementById('results');
          r.innerHTML += message + '&lt;br&gt;';
          r.scrollTop = r.scrollHeight;
      }
              &lt;/script&gt;
          &lt;/head&gt;
          &lt;body&gt;
                &lt;br /&gt;
              &lt;input type="button" onclick="startTask();"  value="Start Long Task" /&gt;
              &lt;input type="button" onclick="stopTask();"  value="Stop Task" /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
  
              &lt;p&gt;Results&lt;/p&gt;
              &lt;br /&gt;
              &lt;div id="results" style="border:1px solid #000; padding:10px; width:300px; height:250px; overflow:auto; background:#eee;"&gt;&lt;/div&gt;
              &lt;br /&gt;
  
              &lt;progress id='progressor' value="0" max='100' style=""&gt;&lt;/progress&gt;  
              &lt;span id="percentage" style="text-align:right; display:block; margin-top:5px;"&gt;0&lt;/span&gt;
          &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>progress.php</p>
  
  <pre><code>&lt;?php
  header('Content-Type: text/event-stream');
  header('Cache-Control: no-cache'); 
  
  function send_message($id, $message, $progress) {
      $d = array('message' =&gt; $message , 'progress' =&gt; $progress);
      echo "id: $id" . PHP_EOL;
      echo "data: " . json_encode($d) . PHP_EOL;
      echo PHP_EOL;
      ob_flush();
      flush();
  }
  
  //LONG RUNNING TASK
  for($i = 1; $i &lt;= 10; $i++) {
      send_message($i, 'on iteration ' . $i . ' of 10' , $i*10); 
      sleep(1);
  }
  
  send_message('CLOSE', 'Process complete');
  </code></pre>