From f272ce8b47a6dd561dc30cbdacf395bcdf885438 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 8 Dec 2011 12:59:25 +0100 Subject: Repeat TFTP read request in case the packet got lost. The TFTP downloads failed when the read request packet got lost. This problem is now fixed by retransmitting the read request after a while. Signed-off-by: Thomas Huth --- clients/net-snk/app/netlib/tftp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clients/net-snk/app/netlib/tftp.c b/clients/net-snk/app/netlib/tftp.c index e8e9d09..dd1e752 100644 --- a/clients/net-snk/app/netlib/tftp.c +++ b/clients/net-snk/app/netlib/tftp.c @@ -556,8 +556,14 @@ tftp(filename_ip_t * _fn_ip, unsigned char *_buffer, int _len, if(get_timer() <= 0) { /* the server doesn't seem to retry let's help out a bit */ if (tftp_err->no_packets > 4 && port_number != -1 - && block > 1) + && block > 1) { send_ack(block, port_number); + } + else if (port_number == -1 && block == 0 + && (tftp_err->no_packets&3) == 3) { + printf("\nRepeating TFTP read request...\n"); + send_rrq(); + } tftp_err->no_packets++; set_timer(TICKS_SEC); } -- cgit v1.1