diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-09 03:15:05 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-09 03:15:05 +0000 |
commit | 9e95920efd3b8c0c1fa949795fed7a5cbcee3d0c (patch) | |
tree | 70ee2c6f78727bb04dfa7e9bfe41470ef9998868 /networking/ftpd.c | |
parent | 51c9bb1fd1eb60155d322885a5bc830ee016e2b0 (diff) | |
download | busybox-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.c | 22 |
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 | |||
206 | static void | 208 | static void |
207 | handle_pwd(void) | 209 | handle_pwd(void) |
208 | { | 210 | { |
@@ -254,6 +256,14 @@ handle_type(void) | |||
254 | } | 256 | } |
255 | 257 | ||
256 | static void | 258 | static void |
259 | handle_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 | |||
266 | static void | ||
257 | handle_help(void) | 267 | handle_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 | |||
270 | static void | 282 | static void |
271 | init_data_sock_params(int sock_fd) | 283 | init_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 | |||
533 | static char * | 547 | static char * |
534 | statbuf_getperms(const struct stat *statbuf) | 548 | statbuf_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 | ||
717 | static void | 731 | /* Upload commands */ |
718 | handle_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 |
726 | static void | 734 | static void |