diff options
Diffstat (limited to 'apps/netutils/tftpc')
-rw-r--r-- | apps/netutils/tftpc/tftpc_get.c | 2 | ||||
-rw-r--r-- | apps/netutils/tftpc/tftpc_packets.c | 4 | ||||
-rw-r--r-- | apps/netutils/tftpc/tftpc_put.c | 12 |
3 files changed, 13 insertions, 5 deletions
diff --git a/apps/netutils/tftpc/tftpc_get.c b/apps/netutils/tftpc/tftpc_get.c index bfae1a3b7..b2170ec39 100644 --- a/apps/netutils/tftpc/tftpc_get.c +++ b/apps/netutils/tftpc/tftpc_get.c @@ -234,7 +234,7 @@ int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary) /* Check if anything valid was received */ - if (nbytesrecvd >= 0) + if (nbytesrecvd > 0) { /* Verify the sender address and port number */ diff --git a/apps/netutils/tftpc/tftpc_packets.c b/apps/netutils/tftpc/tftpc_packets.c index d43410ff4..d1370efd8 100644 --- a/apps/netutils/tftpc/tftpc_packets.c +++ b/apps/netutils/tftpc/tftpc_packets.c @@ -1,8 +1,8 @@ /**************************************************************************** * netuils/tftp/tftpc_packets.c * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/apps/netutils/tftpc/tftpc_put.c b/apps/netutils/tftpc/tftpc_put.c index c292244a6..b36599718 100644 --- a/apps/netutils/tftpc/tftpc_put.c +++ b/apps/netutils/tftpc/tftpc_put.c @@ -217,9 +217,17 @@ static int tftp_rcvack(int sd, uint8_t *packet, struct sockaddr_in *server, { /* Failed to receive a good packet */ - if (nbytes >= 0) + if (nbytes == 0) { - ndbg("tftp_recvfrom short packet: %d bytes\n", nbytes); + ndbg("Connection lost: %d bytes\n", nbytes); + } + else if (nbytes > 0) + { + ndbg("Short packet: %d bytes\n", nbytes); + } + else + { + ndbg("Recveid failure\n"); } /* Break out to bump up the retry count */ |