diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-09-06 00:16:09 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-09-06 00:16:09 +0000 |
commit | 6d7ca07be40bb4cc6844dec2ec2787afb5f561d4 (patch) | |
tree | 86833d9621d6efbc4280309bc3a079d0019f6131 /nuttx/netutils/tftpc | |
parent | 1b20fc500d738afac1cc8960b4e533b94758e4c2 (diff) | |
download | px4-nuttx-6d7ca07be40bb4cc6844dec2ec2787afb5f561d4.tar.gz px4-nuttx-6d7ca07be40bb4cc6844dec2ec2787afb5f561d4.tar.bz2 px4-nuttx-6d7ca07be40bb4cc6844dec2ec2787afb5f561d4.zip |
Add get and put commands to NSH
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@880 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils/tftpc')
-rw-r--r-- | nuttx/netutils/tftpc/tftpc_get.c | 2 | ||||
-rw-r--r-- | nuttx/netutils/tftpc/tftpc_put.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/nuttx/netutils/tftpc/tftpc_get.c b/nuttx/netutils/tftpc/tftpc_get.c index 49c39a2cb..bb2f96267 100644 --- a/nuttx/netutils/tftpc/tftpc_get.c +++ b/nuttx/netutils/tftpc/tftpc_get.c @@ -323,7 +323,7 @@ int tftpget(const char *remote, const char *local, in_addr_t addr, boolean binar */ #if CONFIG_NETUTILS_TFTP_ACKPACKETS > 1 - if (ndatabytes < blockno != lastacked) + if (ndatabytes < TFTP_DATASIZE && blockno != lastacked) { len = tftp_mkackpacket(packet, blockno); ret = tftp_sendto(sd, packet, len, &server); diff --git a/nuttx/netutils/tftpc/tftpc_put.c b/nuttx/netutils/tftpc/tftpc_put.c index 73004bdbc..1d19a2d74 100644 --- a/nuttx/netutils/tftpc/tftpc_put.c +++ b/nuttx/netutils/tftpc/tftpc_put.c @@ -402,7 +402,7 @@ int tftpput(const char *local, const char *remote, in_addr_t addr, boolean binar #if CONFIG_NETUTILS_TFTP_ACKPACKETS > 1 /* Construct the next data packet */ - packetlen = tftp_mkdatapacket(fd, offset[tail], packet, blockno); + packetlen = tftp_mkdatapacket(fd, offsets[tail], packet, blockno); if (packetlen < 0) { goto errout_with_sd; @@ -474,7 +474,6 @@ int tftpput(const char *local, const char *remote, in_addr_t addr, boolean binar #if CONFIG_NETUTILS_TFTP_ACKPACKETS > 1 if (blockno - hblockno >= CONFIG_NETUTILS_TFTP_ACKPACKETS || eof) { - uint16 rblockno; int ndx; /* Get the next ACK from the wire */ |