httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r794096 - in /httpd/mod_ftp/trunk: include/mod_ftp.h modules/ftp/ftp_commands.c
Date Tue, 14 Jul 2009 22:25:27 GMT
Author: wrowe
Date: Tue Jul 14 22:25:27 2009
New Revision: 794096

URL: http://svn.apache.org/viewvc?rev=794096&view=rev
Log:
Simplify the FEAT-only extensions with their own macro, which
won't confuse the parser.

Modified:
    httpd/mod_ftp/trunk/include/mod_ftp.h
    httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c

Modified: httpd/mod_ftp/trunk/include/mod_ftp.h
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/include/mod_ftp.h?rev=794096&r1=794095&r2=794096&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/include/mod_ftp.h (original)
+++ httpd/mod_ftp/trunk/include/mod_ftp.h Tue Jul 14 22:25:27 2009
@@ -260,6 +260,16 @@
     ftp_hook_cmd_any((aliascmd), NULL, (basecmd), (order), \
                      (flags) , (desc))
 
+/*
+ * This this for registration of a non-command based feature which should
+ * be reported by the FEAT query, but not the HELP query.  An example is
+ * "REST STREAM", where the HELP command and hook is registered for REST,
+ * but the FEAT advertised is "REST STREAM".
+ */
+#define ftp_feat_advert(feature) \
+    ftp_hook_cmd_any((feature), NULL, NULL, FTP_HOOK_LAST, \
+                     FTP_NEW_FEAT | FTP_NO_HELP, "")
+
 #ifdef __cplusplus
 }
 #endif

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c?rev=794096&r1=794095&r2=794096&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Tue Jul 14 22:25:27 2009
@@ -77,12 +77,6 @@
     key = apr_pstrdup(FTPMethodPool, key);
     help = apr_pstrdup(FTPMethodPool, help);
 
-    /* Commands with a space are only for FTP_NEW_FEAT display, so
-     * we fix this display bit for convenience at registration time
-     */
-    if (strchr(key, ' '))
-        flags |= FTP_NO_HELP;
-
     cmd->key = key;
     cmd->pf = pf;
     cmd->alias = alias;
@@ -2883,10 +2877,7 @@
                  FTP_TAKE1,
                  "<sp> mechanism-name");
 
-    /* Register the AUTH TLS mechanism for FEAT advertising */
-    ftp_hook_cmd("AUTH TLS", NULL, FTP_HOOK_LAST,
-                 FTP_NEW_FEAT,
-                 "<sp> mechanism-name");
+    ftp_feat_advert("AUTH TLS");
 
     ftp_hook_cmd("CDUP", ftp_cmd_cdup, FTP_HOOK_LAST,
                  FTP_NEED_LOGIN | FTP_TAKE0,
@@ -2978,10 +2969,7 @@
                  FTP_NEED_LOGIN | FTP_TAKE1,
                  "<sp> offset (restart command)");
 
-    /* Register the REST STREAM mechanism for FEAT advertising */
-    ftp_hook_cmd("REST STREAM", ftp_cmd_rest, FTP_HOOK_LAST,
-                 FTP_NEW_FEAT,
-                 "<sp> offset (restart command)");
+    ftp_feat_advert("REST STREAM");
 
     ftp_hook_cmd("RETR", ftp_cmd_retr, FTP_HOOK_LAST,
                  FTP_NEED_LOGIN | FTP_TAKE1,



Mime
View raw message