aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-03-05 23:38:54 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-03-05 23:38:54 +0100
commitcbcc1236f806f18e6386e6e1f495a9832b7d307d (patch)
tree57679535a2d1ac60a6f2b3a21dc6afa9028b0cc0
parent4b1100edd8180efa2e81860ef2fadeebcb21f5fa (diff)
downloadbusybox-w32-cbcc1236f806f18e6386e6e1f495a9832b7d307d.tar.gz
busybox-w32-cbcc1236f806f18e6386e6e1f495a9832b7d307d.tar.bz2
busybox-w32-cbcc1236f806f18e6386e6e1f495a9832b7d307d.zip
tftp: do not show progress bar if we get error right away. +13 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/libbb.h1
-rw-r--r--libbb/progress.c1
-rw-r--r--networking/Config.in7
-rw-r--r--networking/dnsd.c10
-rw-r--r--networking/tftp.c3
5 files changed, 14 insertions, 8 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 515e995d0..ead1020dd 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1490,6 +1490,7 @@ typedef struct bb_progress_t {
1490 off_t lastsize; 1490 off_t lastsize;
1491 unsigned lastupdate_sec; 1491 unsigned lastupdate_sec;
1492 unsigned start_sec; 1492 unsigned start_sec;
1493 smallint inited;
1493} bb_progress_t; 1494} bb_progress_t;
1494 1495
1495void bb_progress_init(bb_progress_t *p) FAST_FUNC; 1496void bb_progress_init(bb_progress_t *p) FAST_FUNC;
diff --git a/libbb/progress.c b/libbb/progress.c
index 3a245ae6c..0e484da6c 100644
--- a/libbb/progress.c
+++ b/libbb/progress.c
@@ -57,6 +57,7 @@ void FAST_FUNC bb_progress_init(bb_progress_t *p)
57 p->start_sec = monotonic_sec(); 57 p->start_sec = monotonic_sec();
58 p->lastupdate_sec = p->start_sec; 58 p->lastupdate_sec = p->start_sec;
59 p->lastsize = 0; 59 p->lastsize = 0;
60 p->inited = 1;
60} 61}
61 62
62void FAST_FUNC bb_progress_update(bb_progress_t *p, 63void FAST_FUNC bb_progress_update(bb_progress_t *p,
diff --git a/networking/Config.in b/networking/Config.in
index 90d905ee6..b01c38e51 100644
--- a/networking/Config.in
+++ b/networking/Config.in
@@ -860,7 +860,7 @@ config TFTPD
860 or from udpsvd. Example: "udpsvd -E 0 69 tftpd DIR" 860 or from udpsvd. Example: "udpsvd -E 0 69 tftpd DIR"
861 861
862config FEATURE_TFTP_GET 862config FEATURE_TFTP_GET
863 bool "Enable \"get\" command" 863 bool "Enable 'tftp get' and/or tftpd upload code"
864 default y 864 default y
865 depends on TFTP || TFTPD 865 depends on TFTP || TFTPD
866 help 866 help
@@ -868,8 +868,11 @@ config FEATURE_TFTP_GET
868 a client to retrieve a file from a TFTP server. 868 a client to retrieve a file from a TFTP server.
869 Also enable upload support in tftpd, if tftpd is selected. 869 Also enable upload support in tftpd, if tftpd is selected.
870 870
871 Note: this option does _not_ make tftpd capable of download
872 (the usual operation people need from it)!
873
871config FEATURE_TFTP_PUT 874config FEATURE_TFTP_PUT
872 bool "Enable \"put\" command" 875 bool "Enable 'tftp put' and/or tftpd download code"
873 default y 876 default y
874 depends on TFTP || TFTPD 877 depends on TFTP || TFTPD
875 help 878 help
diff --git a/networking/dnsd.c b/networking/dnsd.c
index e73e244b0..6771c5346 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -376,11 +376,6 @@ static int process_packet(struct dns_entry *conf_data,
376 /* QR = 1 "response", RCODE = 4 "Not Implemented" */ 376 /* QR = 1 "response", RCODE = 4 "Not Implemented" */
377 outr_flags = htons(0x8000 | 4); 377 outr_flags = htons(0x8000 | 4);
378 err_msg = NULL; 378 err_msg = NULL;
379 /* OPCODE != 0 "standard query" ? */
380 if ((head->flags & htons(0x7800)) != 0) {
381 err_msg = "opcode != 0";
382 goto empty_packet;
383 }
384 379
385 /* start of query string */ 380 /* start of query string */
386 query_string = (void *)(head + 1); 381 query_string = (void *)(head + 1);
@@ -392,6 +387,11 @@ static int process_packet(struct dns_entry *conf_data,
392 /* where to append answer block */ 387 /* where to append answer block */
393 answb = (void *)(unaligned_type_class + 1); 388 answb = (void *)(unaligned_type_class + 1);
394 389
390 /* OPCODE != 0 "standard query"? */
391 if ((head->flags & htons(0x7800)) != 0) {
392 err_msg = "opcode != 0";
393 goto empty_packet;
394 }
395 move_from_unaligned16(class, &unaligned_type_class->class); 395 move_from_unaligned16(class, &unaligned_type_class->class);
396 if (class != htons(1)) { /* not class INET? */ 396 if (class != htons(1)) { /* not class INET? */
397 err_msg = "class != 1"; 397 err_msg = "class != 1";
diff --git a/networking/tftp.c b/networking/tftp.c
index 0e5b48d40..d76f7ae5b 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -135,7 +135,8 @@ static void tftp_progress_init(void)
135} 135}
136static void tftp_progress_done(void) 136static void tftp_progress_done(void)
137{ 137{
138 progress_meter(0); 138 if (G.pmt.inited)
139 progress_meter(0);
139} 140}
140#else 141#else
141# define tftp_progress_init() ((void)0) 142# define tftp_progress_init() ((void)0)