diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-02-11 18:56:13 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-02-11 18:56:13 +0100 |
commit | d55e13964916af6a083be881bffdb493af287c1d (patch) | |
tree | 399af6f19989d3efedb0a66f0e7b99184b245bb9 /networking/tftp.c | |
parent | e52e67cb512e775fd83ca399cc807c363ba59dcc (diff) | |
download | busybox-w32-d55e13964916af6a083be881bffdb493af287c1d.tar.gz busybox-w32-d55e13964916af6a083be881bffdb493af287c1d.tar.bz2 busybox-w32-d55e13964916af6a083be881bffdb493af287c1d.zip |
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/tftp.c')
-rw-r--r-- | networking/tftp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/tftp.c b/networking/tftp.c index fcd933f6a..2a3991755 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -107,19 +107,19 @@ struct BUG_G_too_big { | |||
107 | #if ENABLE_FEATURE_TFTP_PROGRESS_BAR | 107 | #if ENABLE_FEATURE_TFTP_PROGRESS_BAR |
108 | static void tftp_progress_update(void) | 108 | static void tftp_progress_update(void) |
109 | { | 109 | { |
110 | bb_progress_update(&G.pmt, G.file, 0, G.pos, G.size); | 110 | bb_progress_update(&G.pmt, 0, G.pos, G.size); |
111 | } | 111 | } |
112 | static void tftp_progress_init(void) | 112 | static void tftp_progress_init(void) |
113 | { | 113 | { |
114 | bb_progress_init(&G.pmt); | 114 | bb_progress_init(&G.pmt, G.file); |
115 | tftp_progress_update(); | 115 | tftp_progress_update(); |
116 | } | 116 | } |
117 | static void tftp_progress_done(void) | 117 | static void tftp_progress_done(void) |
118 | { | 118 | { |
119 | if (G.pmt.inited) { | 119 | if (is_bb_progress_inited(&G.pmt)) { |
120 | tftp_progress_update(); | 120 | tftp_progress_update(); |
121 | bb_putchar_stderr('\n'); | 121 | bb_putchar_stderr('\n'); |
122 | G.pmt.inited = 0; | 122 | bb_progress_free(p); |
123 | } | 123 | } |
124 | } | 124 | } |
125 | #else | 125 | #else |
@@ -445,7 +445,7 @@ static int tftp_protocol( | |||
445 | #if ENABLE_FEATURE_TFTP_PROGRESS_BAR | 445 | #if ENABLE_FEATURE_TFTP_PROGRESS_BAR |
446 | if (ENABLE_TFTP && remote_file) /* tftp */ | 446 | if (ENABLE_TFTP && remote_file) /* tftp */ |
447 | G.pos = (block_nr - 1) * (uoff_t)blksize; | 447 | G.pos = (block_nr - 1) * (uoff_t)blksize; |
448 | if (G.pmt.inited) | 448 | if (is_bb_progress_inited(&G.pmt)) |
449 | tftp_progress_update(); | 449 | tftp_progress_update(); |
450 | #endif | 450 | #endif |
451 | /* Was it final ACK? then exit */ | 451 | /* Was it final ACK? then exit */ |