We were seeing some timeouts when getting files with the busybox tftp
client.
With tcpdump, we saw that the tftp client was receiving blocks and
ack'ing them, but the server was failing to receive the occasional
ack.
When that happened, the server would send the last block over again,
but the tftp client was expecting the next block.
This patch allows the client to recover from this situation
(it sends an ack for the repeat block but does not write it
to the local file).
I hope it meets your approval, please don't hesitate to send
me comments for improvement.
The patch is against "head" in svn, I tested it on an older version
of busybox in our environment. It applied cleanly to the older
version.
Credit for this goes to my co-worker John McCarthy for finding
it and me for fixing it (assuming it works for everyone else too).
cheerio,
bjb
Hi,
Package: BusyBox
Version: 1.0.0-pre10
When an incomplete read or write from/to a local file occurs (i.e.
not an EOF condition), the tftp client prematurely exits. This
problem can be reproduced by slowly piping data to the tftp client
like this:
(for v in 1 2 3; do echo $v; sleep 1; done) | \
tftp -p -l - -r output.txt <host>
The output file on the TFTP server will contain "1".
The attached patch provides a possible solution to this problem.
I can reproduce this on ARM sa1110 and ARM xscale boards, both
running Linux-2.6.4 & glibc-2.3.2. Thanks for the wonderful
program!
Robin