diff options
author | Ryan Bloom <rbb@apache.org> | 2001-08-02 06:25:20 +0200 |
---|---|---|
committer | Ryan Bloom <rbb@apache.org> | 2001-08-02 06:25:20 +0200 |
commit | 85e8fbd0e21fec6cb8c6cb0af6cdb8c592bbec67 (patch) | |
tree | 1c5c5f4c5b2d63f794243cdc2732fce82ccf12c4 /server/config.c | |
parent | Need some context for the iterator! Finally get to use that accessor :) (diff) | |
download | apache2-85e8fbd0e21fec6cb8c6cb0af6cdb8c592bbec67.tar.xz apache2-85e8fbd0e21fec6cb8c6cb0af6cdb8c592bbec67.zip |
Add the ability to extend the methods that Apache understands
and have those methods <limit>able in the httpd.conf. It uses
the same bit mask/shifted offset as the original HTTP methods
such as M_GET or M_POST, but expands the total bits from an int to
an ap_int64_t to handle more bits for new request methods than
an int provides.
Submitted by: Cody Sherr <csherr@covalent.net>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/config.c')
-rw-r--r-- | server/config.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/server/config.c b/server/config.c index 7b7cf32f74..1896d61772 100644 --- a/server/config.c +++ b/server/config.c @@ -354,30 +354,18 @@ AP_CORE_DECLARE(int) ap_invoke_handler(request_rec *r) AP_DECLARE(int) ap_method_is_limited(cmd_parms *cmd, const char *method) { int methnum; - int i; - char **xmethod; methnum = ap_method_number_of(method); + /* - * The simple case: a method hard-coded into Apache. + * A method number either hardcoded into apache or + * added by a module and registered. */ if (methnum != M_INVALID) { - return (methnum & cmd->limited); + return (cmd->limited & (1<<methnum)); } - /* - * Some extension method we don't know implicitly. - */ - if ((cmd->limited_xmethods == NULL) - || (cmd->limited_xmethods->nelts == 0)) { - return 0; - } - xmethod = (char **) cmd->limited_xmethods->elts; - for (i = 0; i < cmd->limited_xmethods->nelts; ++i) { - if (strcmp(method, xmethod[i]) == 0) { - return 1; - } - } - return 0; + + return 0; /* not found */ } AP_DECLARE(void) ap_register_hooks(module *m, apr_pool_t *p) |