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

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2011-04-11 04:29:39 +02:00
parent c13ee8c0f3
commit 24ec952f14

View File

@ -455,6 +455,7 @@ static int tftp_protocol(
finished = 1; finished = 1;
} }
cp += len; cp += len;
IF_FEATURE_TFTP_PROGRESS_BAR(G.pos += len;)
} }
send_pkt: send_pkt:
/* Send packet */ /* Send packet */
@ -476,8 +477,6 @@ static int tftp_protocol(
xsendto(socket_fd, xbuf, send_len, &peer_lsa->u.sa, peer_lsa->len); xsendto(socket_fd, xbuf, send_len, &peer_lsa->u.sa, peer_lsa->len);
#if ENABLE_FEATURE_TFTP_PROGRESS_BAR #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)) if (is_bb_progress_inited(&G.pmt))
tftp_progress_update(); tftp_progress_update();
#endif #endif
@ -621,6 +620,7 @@ static int tftp_protocol(
if (sz != blksize) { if (sz != blksize) {
finished = 1; finished = 1;
} }
IF_FEATURE_TFTP_PROGRESS_BAR(G.pos += sz;)
continue; /* send ACK */ continue; /* send ACK */
} }
/* Disabled to cope with servers with Sorcerer's Apprentice Syndrome */ /* Disabled to cope with servers with Sorcerer's Apprentice Syndrome */