commit 8ba13c66798d5acf1da756da3837dc6edc2fe729
parent f2f547e906d187f0dfda05508b8146ef6910a9ec
Author: ukai <ukai>
Date: Thu, 23 Jan 2003 16:05:54 +0000
[w3m-dev 03680] showProgress() on fast system
* file.c (showProgress): check line len, time
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat:
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,5 +1,10 @@
2003-01-24 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03680] showProgress() on fast system
+ * file.c (showProgress): check line len, time
+
+2003-01-24 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03679] Re: cleanup for pipe
* etc.c (open_pipe_rw): check stdin, stdout
* file.c (uncompress_stream): rewrite
diff --git a/file.c b/file.c
@@ -6182,12 +6182,11 @@ showProgress(clen_t * linelen, clen_t * trbyte)
if (!fmInitialized)
return;
+ if (*linelen < 1024)
+ return;
if (current_content_length > 0) {
double ratio;
cur_time = time(0);
- if (cur_time == last_time)
- return;
- last_time = cur_time;
if (*trbyte == 0) {
move(LASTLINE, 0);
clrtoeolx();
@@ -6195,6 +6194,9 @@ showProgress(clen_t * linelen, clen_t * trbyte)
}
*trbyte += *linelen;
*linelen = 0;
+ if (cur_time == last_time)
+ return;
+ last_time = cur_time;
move(LASTLINE, 0);
ratio = 100.0 * (*trbyte) / current_content_length;
fmtrbyte = convert_size2(*trbyte, current_content_length, 1);
@@ -6231,11 +6233,8 @@ showProgress(clen_t * linelen, clen_t * trbyte)
/* no_clrtoeol(); */
refresh();
}
- else if (*linelen > 1000) {
+ else {
cur_time = time(0);
- if (cur_time == last_time)
- return;
- last_time = cur_time;
if (*trbyte == 0) {
move(LASTLINE, 0);
clrtoeolx();
@@ -6243,6 +6242,9 @@ showProgress(clen_t * linelen, clen_t * trbyte)
}
*trbyte += *linelen;
*linelen = 0;
+ if (cur_time == last_time)
+ return;
+ last_time = cur_time;
move(LASTLINE, 0);
fmtrbyte = convert_size(*trbyte, 1);
duration = cur_time - start_time;