summaryrefslogtreecommitdiffstats
path: root/modules/mappers/mod_actions.c
diff options
context:
space:
mode:
authorAndré Malo <nd@apache.org>2003-02-14 01:43:52 +0100
committerAndré Malo <nd@apache.org>2003-02-14 01:43:52 +0100
commitc84887c3771696665d9ef60ac54462b80f8dc491 (patch)
treef298f3c23f76edc84514cd5ce6577cedef639156 /modules/mappers/mod_actions.c
parentstyle. (diff)
downloadapache2-c84887c3771696665d9ef60ac54462b80f8dc491.tar.xz
apache2-c84887c3771696665d9ef60ac54462b80f8dc491.zip
Forward port of mod_actions' ability to handle arbitrary methods
with the Script directive. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98646 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers/mod_actions.c')
-rw-r--r--modules/mappers/mod_actions.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/modules/mappers/mod_actions.c b/modules/mappers/mod_actions.c
index 1f95fa68f0..578792b700 100644
--- a/modules/mappers/mod_actions.c
+++ b/modules/mappers/mod_actions.c
@@ -142,17 +142,23 @@ static const char *set_script(cmd_parms *cmd, void *m_v,
const char *method, const char *script)
{
action_dir_config *m = (action_dir_config *)m_v;
- int methnum;
+
+ /* ap_method_register recognizes already registered methods,
+ * so don't bother to check its previous existence explicitely.
+ */
+ int methnum = ap_method_register(cmd->pool, method);
- methnum = ap_method_number_of(method);
- if (methnum == M_TRACE)
+ if (methnum == M_TRACE) {
return "TRACE not allowed for Script";
- else if (methnum == M_INVALID)
- return "Unknown method type for Script";
- else
- m->scripted[methnum] = script;
+ }
+ else if (methnum == M_INVALID) {
+ return apr_pstrcat(cmd->pool, "Could not register method '", method,
+ "' for Script", NULL);
+ }
+ m->scripted[methnum] = script;
m->configured = 1;
+
return NULL;
}