aboutsummaryrefslogtreecommitdiff
path: root/networking/ftpd.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-03-09 03:15:05 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-03-09 03:15:05 +0000
commit9e95920efd3b8c0c1fa949795fed7a5cbcee3d0c (patch)
tree70ee2c6f78727bb04dfa7e9bfe41470ef9998868 /networking/ftpd.c
parent51c9bb1fd1eb60155d322885a5bc830ee016e2b0 (diff)
downloadbusybox-w32-9e95920efd3b8c0c1fa949795fed7a5cbcee3d0c.tar.gz
busybox-w32-9e95920efd3b8c0c1fa949795fed7a5cbcee3d0c.tar.bz2
busybox-w32-9e95920efd3b8c0c1fa949795fed7a5cbcee3d0c.zip
ftpd: code shuffled a bit, added comments
Diffstat (limited to '')
-rw-r--r--networking/ftpd.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c
index bdd7a2db4..b794a24c3 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -203,6 +203,8 @@ cmdio_write_raw(const char *p_text)
203 xwrite_str(STDIN_FILENO, p_text); 203 xwrite_str(STDIN_FILENO, p_text);
204} 204}
205 205
206/* Simple commands */
207
206static void 208static void
207handle_pwd(void) 209handle_pwd(void)
208{ 210{
@@ -254,6 +256,14 @@ handle_type(void)
254} 256}
255 257
256static void 258static void
259handle_stat(void)
260{
261 cmdio_write_hyphen(FTP_STATOK, "FTP server status:");
262 cmdio_write_raw(" TYPE: BINARY\r\n");
263 cmdio_write_ok(FTP_STATOK);
264}
265
266static void
257handle_help(void) 267handle_help(void)
258{ 268{
259 cmdio_write_hyphen(FTP_HELP, "Recognized commands:"); 269 cmdio_write_hyphen(FTP_HELP, "Recognized commands:");
@@ -267,6 +277,8 @@ handle_help(void)
267 cmdio_write(FTP_HELP, "Help OK"); 277 cmdio_write(FTP_HELP, "Help OK");
268} 278}
269 279
280/* Download commands */
281
270static void 282static void
271init_data_sock_params(int sock_fd) 283init_data_sock_params(int sock_fd)
272{ 284{
@@ -530,6 +542,8 @@ handle_retr(void)
530 close(opened_file); 542 close(opened_file);
531} 543}
532 544
545/* List commands */
546
533static char * 547static char *
534statbuf_getperms(const struct stat *statbuf) 548statbuf_getperms(const struct stat *statbuf)
535{ 549{
@@ -714,13 +728,7 @@ handle_stat_file(void)
714 handle_dir_common(1, 1); 728 handle_dir_common(1, 1);
715} 729}
716 730
717static void 731/* Upload commands */
718handle_stat(void)
719{
720 cmdio_write_hyphen(FTP_STATOK, "FTP server status:");
721 cmdio_write_raw(" TYPE: BINARY\r\n");
722 cmdio_write_ok(FTP_STATOK);
723}
724 732
725#if ENABLE_FEATURE_FTP_WRITE 733#if ENABLE_FEATURE_FTP_WRITE
726static void 734static void