summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko2011-02-11 18:56:13 +0100
committerDenys Vlasenko2011-02-11 18:56:13 +0100
commitd55e13964916af6a083be881bffdb493af287c1d (patch)
tree399af6f19989d3efedb0a66f0e7b99184b245bb9 /networking
parente52e67cb512e775fd83ca399cc807c363ba59dcc (diff)
downloadbusybox-d55e13964916af6a083be881bffdb493af287c1d.zip
busybox-d55e13964916af6a083be881bffdb493af287c1d.tar.gz
progress meter: move file name to bb_progress_t. +20 bytes
We were doing expensive unicode conversion on every update Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/tftp.c10
-rw-r--r--networking/wget.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index fcd933f..2a39917 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -107,19 +107,19 @@ struct BUG_G_too_big {
#if ENABLE_FEATURE_TFTP_PROGRESS_BAR
static void tftp_progress_update(void)
{
- bb_progress_update(&G.pmt, G.file, 0, G.pos, G.size);
+ bb_progress_update(&G.pmt, 0, G.pos, G.size);
}
static void tftp_progress_init(void)
{
- bb_progress_init(&G.pmt);
+ bb_progress_init(&G.pmt, G.file);
tftp_progress_update();
}
static void tftp_progress_done(void)
{
- if (G.pmt.inited) {
+ if (is_bb_progress_inited(&G.pmt)) {
tftp_progress_update();
bb_putchar_stderr('\n');
- G.pmt.inited = 0;
+ bb_progress_free(p);
}
}
#else
@@ -445,7 +445,7 @@ static int tftp_protocol(
#if ENABLE_FEATURE_TFTP_PROGRESS_BAR
if (ENABLE_TFTP && remote_file) /* tftp */
G.pos = (block_nr - 1) * (uoff_t)blksize;
- if (G.pmt.inited)
+ if (is_bb_progress_inited(&G.pmt))
tftp_progress_update();
#endif
/* Was it final ACK? then exit */
diff --git a/networking/wget.c b/networking/wget.c
index d81426e..f2d7daf 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -81,9 +81,9 @@ static void progress_meter(int flag)
return;
if (flag == PROGRESS_START)
- bb_progress_init(&G.pmt);
+ bb_progress_init(&G.pmt, G.curfile);
- bb_progress_update(&G.pmt, G.curfile, G.beg_range, G.transferred,
+ bb_progress_update(&G.pmt, G.beg_range, G.transferred,
G.chunked ? 0 : G.beg_range + G.transferred + G.content_len);
if (flag == PROGRESS_END) {