summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2001-08-03 00:59:01 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2001-08-03 00:59:01 +0000
commit5f9b514613df5f052639712247a5aa3954f4f9bd (patch)
tree9fcc4fcfe52ea00c8718458faef5763e8ffadd4e
parent98747ddffa625bb27747fcb625339c18af9bf967 (diff)
downloadhttpd-5f9b514613df5f052639712247a5aa3954f4f9bd.tar.gz
Provide an ap_set_deprecated() fn for quick-and-dirty 'we don't do this'
entries in the command table. (Also fixes a nit about returning a single bit of an apr_int_64 as an int. Know how this group loves !! expresssions :) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89896 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/http_config.h14
-rw-r--r--server/config.c10
2 files changed, 22 insertions, 2 deletions
diff --git a/include/http_config.h b/include/http_config.h
index 9e4a524d47..84903fbbfc 100644
--- a/include/http_config.h
+++ b/include/http_config.h
@@ -505,7 +505,19 @@ AP_DECLARE_NONSTD(const char *) ap_set_flag_slot(cmd_parms *cmd, void *struct_pt
* @return An error string or NULL on success
*/
AP_DECLARE_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, void *struct_ptr, const char *arg);
-
+/**
+ * Generic command handling function to respond with cmd->help as an error
+ * @param cmd The command parameters for this directive
+ * @param struct_ptr pointer into a given type
+ * @param arg The argument to the directive
+ * @return The cmd->help value as the error string
+ * @tip This allows simple declarations such as;
+ * <pre>
+ * AP_INIT_RAW_ARGS("Foo", ap_set_deprecated, NULL, OR_ALL,
+ * "The Foo directive is no longer supported, use Bar"),
+ * </pre>
+ */
+AP_DECLARE_NONSTD(const char *) ap_set_deprecated(cmd_parms *cmd, void *struct_ptr, const char *arg);
/**
* For modules which need to read config files, open logs, etc. ...
* this returns the fname argument if it begins with '/'; otherwise
diff --git a/server/config.c b/server/config.c
index 1896d61772..a8f1f26b5e 100644
--- a/server/config.c
+++ b/server/config.c
@@ -362,7 +362,7 @@ AP_DECLARE(int) ap_method_is_limited(cmd_parms *cmd, const char *method) {
* added by a module and registered.
*/
if (methnum != M_INVALID) {
- return (cmd->limited & (1<<methnum));
+ return !!(cmd->limited & (1<<methnum));
}
return 0; /* not found */
@@ -1171,6 +1171,14 @@ AP_DECLARE_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, void *struct_pt
return NULL;
}
+AP_DECLARE_NONSTD(const char *) ap_set_deprecated(cmd_parms *cmd,
+ void *struct_ptr,
+ const char *arg)
+{
+ /* This one's really generic... */
+ return cmd->cmd->errmsg;
+}
+
/*****************************************************************
*
* Reading whole config files...