summaryrefslogtreecommitdiff
path: root/networking/ftpd.c
diff options
context:
space:
mode:
authorDenis Vlasenko2009-03-09 03:15:05 +0000
committerDenis Vlasenko2009-03-09 03:15:05 +0000
commit9e95920efd3b8c0c1fa949795fed7a5cbcee3d0c (patch)
tree70ee2c6f78727bb04dfa7e9bfe41470ef9998868 /networking/ftpd.c
parent51c9bb1fd1eb60155d322885a5bc830ee016e2b0 (diff)
downloadbusybox-9e95920efd3b8c0c1fa949795fed7a5cbcee3d0c.zip
busybox-9e95920efd3b8c0c1fa949795fed7a5cbcee3d0c.tar.gz
ftpd: code shuffled a bit, added comments
Diffstat (limited to 'networking/ftpd.c')
-rw-r--r--networking/ftpd.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c
index bdd7a2d..b794a24 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -203,6 +203,8 @@ cmdio_write_raw(const char *p_text)
xwrite_str(STDIN_FILENO, p_text);
}
+/* Simple commands */
+
static void
handle_pwd(void)
{
@@ -254,6 +256,14 @@ handle_type(void)
}
static void
+handle_stat(void)
+{
+ cmdio_write_hyphen(FTP_STATOK, "FTP server status:");
+ cmdio_write_raw(" TYPE: BINARY\r\n");
+ cmdio_write_ok(FTP_STATOK);
+}
+
+static void
handle_help(void)
{
cmdio_write_hyphen(FTP_HELP, "Recognized commands:");
@@ -267,6 +277,8 @@ handle_help(void)
cmdio_write(FTP_HELP, "Help OK");
}
+/* Download commands */
+
static void
init_data_sock_params(int sock_fd)
{
@@ -530,6 +542,8 @@ handle_retr(void)
close(opened_file);
}
+/* List commands */
+
static char *
statbuf_getperms(const struct stat *statbuf)
{
@@ -714,13 +728,7 @@ handle_stat_file(void)
handle_dir_common(1, 1);
}
-static void
-handle_stat(void)
-{
- cmdio_write_hyphen(FTP_STATOK, "FTP server status:");
- cmdio_write_raw(" TYPE: BINARY\r\n");
- cmdio_write_ok(FTP_STATOK);
-}
+/* Upload commands */
#if ENABLE_FEATURE_FTP_WRITE
static void