summaryrefslogtreecommitdiff
path: root/apps/netutils/ftpc/ftpc_getfile.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-02 01:14:12 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-02 01:14:12 +0000
commit6f39c643ac7af0880f49f7673307053db11218e9 (patch)
tree7d6b9fe3151d71661e51125e108087d3c6f5906c /apps/netutils/ftpc/ftpc_getfile.c
parentdf12f072cba62c2c458a7845b4e9b30c30a4af33 (diff)
downloadnuttx-6f39c643ac7af0880f49f7673307053db11218e9.tar.gz
nuttx-6f39c643ac7af0880f49f7673307053db11218e9.tar.bz2
nuttx-6f39c643ac7af0880f49f7673307053db11218e9.zip
Improved comments
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3658 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/netutils/ftpc/ftpc_getfile.c')
-rw-r--r--apps/netutils/ftpc/ftpc_getfile.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/netutils/ftpc/ftpc_getfile.c b/apps/netutils/ftpc/ftpc_getfile.c
index 095bf2414..039643d0e 100644
--- a/apps/netutils/ftpc/ftpc_getfile.c
+++ b/apps/netutils/ftpc/ftpc_getfile.c
@@ -120,7 +120,27 @@ static int ftpc_recvinit(struct ftpc_session_s *session, FAR const char *path,
session->rstrsize = offset;
}
- /* Send the RETR (Retrieve a remote file) command */
+ /* Send the RETR (Retrieve a remote file) command. Normally the server
+ * responds with a mark using code 150:
+ *
+ * - "150 File status okay; about to open data connection"
+ *
+ * It then stops accepting new connections, attempts to send the contents
+ * of the file over the data connection, and closes the data connection.
+ * Finally it either accepts the RETR request with:
+ *
+ * - "226 Closing data connection" if the entire file was successfully
+ * written to the server's TCP buffers
+ *
+ * Or rejects the RETR request with:
+ *
+ * - "425 Can't open data connection" if no TCP connection was established
+ * - "426 Connection closed; transfer aborted" if the TCP connection was
+ * established but then broken by the client or by network failure
+ * - "451 Requested action aborted: local error in processing" or
+ * "551 Requested action aborted: page type unknown" if the server had
+ * trouble reading the file from disk.
+ */
ret = ftpc_cmd(session, "RETR %s", path);
if (ret < 0)