[git commit] tftp: fix progress bar for large (>32M) files. Closes 3499

Denys Vlasenko vda.linux at googlemail.com
Mon Apr 11 02:29:39 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=24ec952f1403759af280661b83471b28f1158553
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/tftp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/networking/tftp.c b/networking/tftp.c
index f52e49d..e50d925 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -455,6 +455,7 @@ static int tftp_protocol(
 				finished = 1;
 			}
 			cp += len;
+			IF_FEATURE_TFTP_PROGRESS_BAR(G.pos += len;)
 		}
  send_pkt:
 		/* Send packet */
@@ -476,8 +477,6 @@ static int tftp_protocol(
 		xsendto(socket_fd, xbuf, send_len, &peer_lsa->u.sa, peer_lsa->len);
 
 #if ENABLE_FEATURE_TFTP_PROGRESS_BAR
-		if (ENABLE_TFTP && remote_file) /* tftp */
-			G.pos = (block_nr - 1) * (uoff_t)blksize;
 		if (is_bb_progress_inited(&G.pmt))
 			tftp_progress_update();
 #endif
@@ -621,6 +620,7 @@ static int tftp_protocol(
 				if (sz != blksize) {
 					finished = 1;
 				}
+				IF_FEATURE_TFTP_PROGRESS_BAR(G.pos += sz;)
 				continue; /* send ACK */
 			}
 /* Disabled to cope with servers with Sorcerer's Apprentice Syndrome */
-- 
1.7.3.4



More information about the busybox-cvs mailing list