summaryrefslogtreecommitdiff
path: root/nuttx/netutils/tftpc/tftpc_put.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-06 15:44:41 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-06 15:44:41 +0000
commit77598342d00348e0b97f05b2c6735bdf8dde8e33 (patch)
treea6d10071812c10e0221dc7a8d15d603f9e4b1ad8 /nuttx/netutils/tftpc/tftpc_put.c
parentbf15faf28c3826541af41632784beaefdb9a2254 (diff)
downloadpx4-nuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.tar.gz
px4-nuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.tar.bz2
px4-nuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.zip
TFTP Get integration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@885 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils/tftpc/tftpc_put.c')
-rw-r--r--nuttx/netutils/tftpc/tftpc_put.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/nuttx/netutils/tftpc/tftpc_put.c b/nuttx/netutils/tftpc/tftpc_put.c
index ca158a783..b003af3c9 100644
--- a/nuttx/netutils/tftpc/tftpc_put.c
+++ b/nuttx/netutils/tftpc/tftpc_put.c
@@ -114,7 +114,7 @@ static inline ssize_t tftp_read(int fd, ubyte *buf, size_t buflen)
if (nbytesread < 0)
{
- ndbg(g_tftpcallfailed, "read", errno);
+ ndbg("read failed: %d\n", errno);
return ERROR;
}
@@ -175,7 +175,7 @@ int tftp_mkdatapacket(int fd, off_t offset, ubyte *packet, uint16 blockno)
tmp = lseek(fd, offset, SEEK_SET);
if (tmp == (off_t)-1)
{
- ndbg(g_tftpcallfailed, "lseek", errno);
+ ndbg("lseek failed: %d\n", errno);
return ERROR;
}
@@ -245,13 +245,13 @@ static int tftp_rcvack(int sd, ubyte *packet, struct sockaddr_in *server,
if (server->sin_addr.s_addr != from.sin_addr.s_addr)
{
- nvdbg(g_tftpaddress, "recvfrom");
+ nvdbg("Invalid address in DATA\n");
continue;
}
if (*port != server->sin_port)
{
- nvdbg(g_tftpport, "recvfrom");
+ nvdbg("Invalid port in DATA\n");
packetlen = tftp_mkerrpacket(packet, TFTP_ERR_UNKID, TFTP_ERRST_UNKID);
(void)tftp_sendto(sd, packet, packetlen, server);
continue;
@@ -348,7 +348,7 @@ int tftpput(const char *local, const char *remote, in_addr_t addr, boolean binar
packet = (ubyte*)zalloc(TFTP_IOBUFSIZE);
if (!packet)
{
- ndbg(g_tftpnomemory, "packet");
+ ndbg("packet memory allocation failure\n");
errno = ENOMEM;
goto errout;
}
@@ -358,7 +358,7 @@ int tftpput(const char *local, const char *remote, in_addr_t addr, boolean binar
fd = open(local, O_RDONLY);
if (fd < 0)
{
- ndbg(g_tftpcallfailed, "open", errno);
+ ndbg("open failed: %d\n", errno);
goto errout_with_packet;
}
@@ -370,7 +370,7 @@ int tftpput(const char *local, const char *remote, in_addr_t addr, boolean binar
goto errout_with_fd;
}
- /* Send the write request */
+ /* Send the write request using the well known port */
packetlen = tftp_mkreqpacket(packet, TFTP_WRQ, remote, binary);
ret = tftp_sendto(sd, packet, packetlen, &server);