diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-04-19 23:23:17 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-04-19 23:23:17 +0000 |
commit | fd36669693e8cfd4f474bea26283256087c7ad26 (patch) | |
tree | 172780100bb0aedd7e7397cf75b0900ae738008d /usr/local/www/guiconfig.inc | |
parent | cf71c485a3a93e33fe5ce20ef9cc1e5093bed34b (diff) | |
download | pfsense-fd36669693e8cfd4f474bea26283256087c7ad26.zip pfsense-fd36669693e8cfd4f474bea26283256087c7ad26.tar.gz |
Only send javascript update messages when the percentage changes. This avoids sending the clients firefox utilization to 100%
Diffstat (limited to 'usr/local/www/guiconfig.inc')
-rwxr-xr-x | usr/local/www/guiconfig.inc | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index d249d9d..4f0a77a 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -543,19 +543,13 @@ function read_body($ch, $string) { $downloaded += intval($length); $downloadProgress = round(100 * (1 - $downloaded / $file_size), 0); $downloadProgress = 100 - $downloadProgress; - /* - $a = $file_size; - $b = $downloaded; - $c = $downloadProgress; - $text = " Download Status\\n"; - $text .= "---------------------------------\\n"; - $text .= " File size : {$a}\\n"; - $text .= " Downloaded : {$b}\\n"; - $text .= " Percent : {$c}%\\n"; - $text .= "---------------------------------\\n"; + /* + lastseen is used to prevent from spamming firefox with hundreds of + unnecessary javascript update messages which sends the clients + firefox utilization to 100% */ -// $counter++; -// if($counter > 150) { + $lastseen = "-1"; + if($lastseen <> $downloadProgress) { if($sendto == "status") { $tostatus = $static_status . $downloadProgress . "%"; update_status($tostatus); @@ -564,8 +558,8 @@ function read_body($ch, $string) { update_output_window($tooutput); } update_progress_bar($downloadProgress); -// $counter = 0; -// } + $lastseen = $downloadProgress; + } fwrite($fout, $string); return $length; } |