]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
FINALLY Correct ap_http_method()! It is NOT a method, it's a SCHEME!
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 2 Jan 2005 05:33:44 +0000 (05:33 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 2 Jan 2005 05:33:44 +0000 (05:33 +0000)
  Bumped mmn, and ap module cookie, for this function rename.

  It's not a deprecation, as ap_http_method would be a lovely function
  name sometime in the future: to determine what the function name implies.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123882 13f79535-47bb-0310-9956-ffa450edef68

15 files changed:
CHANGES
include/ap_mmn.h
include/http_protocol.h
include/httpd.h
modules/arch/netware/mod_nw_ssl.c
modules/dav/main/util.c
modules/experimental/mod_example.c
modules/generators/mod_info.c
modules/http/http_core.c
modules/mappers/mod_rewrite.c
modules/proxy/mod_proxy.c
modules/ssl/mod_ssl.c
modules/ssl/ssl_engine_vars.c
server/core.c
server/protocol.c

diff --git a/CHANGES b/CHANGES
index d6f79175e6f8faffc3f0d467cdf6e024cf39c5d5..cfc1bfccfdf9cd1761c09868c8e1338526e7439c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ Changes with Apache 2.1.3
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) ap_http_scheme() replaced with ap_http_method() - this function
+     returns the scheme (http v.s. https).
+     [William Rowe]
+
   *) mod_proxy: Fix a request corruption problem and a buffering problem
      which sometimes prevented proxy-sendchunks from working.
      [Jeff Trawick]
index d724fe7ef6f60ac275fd8add393ba485d77f405d..b9488d9d6d3b5303ac7bfd655010f30b961115a1 100644 (file)
  *                      changed ap_add_module, ap_add_loaded_module,
  *                      ap_setup_prelinked_modules, ap_process_resource_config
  * 20040425.1 (2.1.0-dev) Added ap_module_symbol_t and ap_prelinked_module_symbols
+ * 20050101.0 (2.1.2-dev) Axed mixnamed http_method for http_scheme (which it was!)
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20040425
+#define MODULE_MAGIC_NUMBER_MAJOR 20050101
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 1                     /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
index cb2d23886dc5bcb9e33bf3c94d59b2935e0b9e30..434f1821717b2122882504b2b02a33ebe43d6632 100644 (file)
@@ -608,13 +608,13 @@ AP_DECLARE_HOOK(int,post_read_request,(request_rec *r))
 AP_DECLARE_HOOK(int,log_transaction,(request_rec *r))
 
 /**
- * This hook allows modules to retrieve the http method from a request.  This
- * allows Apache modules to easily extend the methods that Apache understands
+ * This hook allows modules to retrieve the http scheme for a request.  This
+ * allows Apache modules to easily extend the schemes that Apache understands
  * @param r The current request
- * @return The http method from the request
- * @deffunc const char *ap_run_http_method(const request_rec *r)
+ * @return The http scheme from the request
+ * @deffunc const char *ap_run_http_scheme(const request_rec *r)
  */
-AP_DECLARE_HOOK(const char *,http_method,(const request_rec *r))
+AP_DECLARE_HOOK(const char *,http_scheme,(const request_rec *r))
 
 /**
  * Return the default port from the current request
index 47e40c92549d704cb769c080641ffa0ac2cea911..ff38d076be6d0d504412c385a7d1970d9cf8ae76 100644 (file)
@@ -278,9 +278,8 @@ extern "C" {
 /**
  * Get the scheme for a request.
  * @param r The request
- * @bug This should be called ap_http_scheme!
  */
-#define ap_http_method(r)      ap_run_http_method(r)
+#define ap_http_scheme(r)      ap_run_http_scheme(r)
 
 /** The default string lengths */
 #define MAX_STRING_LEN HUGE_STRING_LEN
index 3d890ade427c07a9ac467eebd165b4530a584ad6..108deb8a5b9ffd0340f580a8005ce43d1d4ae093 100644 (file)
@@ -759,7 +759,7 @@ static int nwssl_hook_Fixup(request_rec *r)
     return DECLINED;
 }
 
-static const char *nwssl_hook_http_method (const request_rec *r)
+static const char *nwssl_hook_http_scheme(const request_rec *r)
 {
     if (isSecure(r) && !isSecureUpgraded(r))
         return "https";
@@ -854,7 +854,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r,
             if (strcEQ(var, "REQUEST_METHOD")) 
                 result = r->method;
             else if (strcEQ(var, "REQUEST_SCHEME"))
-                result = ap_http_method(r);
+                result = ap_http_scheme(r);
             else if (strcEQ(var, "REQUEST_URI"))
                 result = r->uri;
             else if (strcEQ(var, "REQUEST_FILENAME"))
@@ -1105,9 +1105,9 @@ static void register_hooks(apr_pool_t *p)
     ap_hook_pre_connection(nwssl_pre_connection, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_post_config(nwssl_post_config, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_fixups(nwssl_hook_Fixup, NULL, NULL, APR_HOOK_MIDDLE);
-    ap_hook_http_method(nwssl_hook_http_method,   NULL,NULL, APR_HOOK_MIDDLE);
-    ap_hook_default_port  (nwssl_hook_default_port,  NULL,NULL, APR_HOOK_MIDDLE);
-    ap_hook_insert_filter (ssl_hook_Insert_Filter, NULL,NULL, APR_HOOK_MIDDLE);
+    ap_hook_http_scheme(nwssl_hook_http_scheme, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_default_port(nwssl_hook_default_port, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_insert_filter(ssl_hook_Insert_Filter, NULL, NULL, APR_HOOK_MIDDLE);
 
     APR_REGISTER_OPTIONAL_FN(ssl_is_https);
     APR_REGISTER_OPTIONAL_FN(ssl_var_lookup);
index 7919d62abfb7fa4b5455edf975c8de04779b5701..c1bc5f92b1cf28d26ea501e58c8f95fff5d8182e 100644 (file)
@@ -204,7 +204,7 @@ dav_lookup_result dav_lookup_uri(const char *uri, request_rec * r,
         /* ### not sure this works if the current request came in via https: */
         scheme = r->parsed_uri.scheme;
         if (scheme == NULL)
-            scheme = ap_http_method(r);
+            scheme = ap_http_scheme(r);
 
         /* insert a port if the URI did not contain one */
         if (comp.port == 0)
index 7c7006bce2cd206d5a892b9e715cabb9079c086d..62946fd516a7d7bcfef674d70d95d0791a51417a 100644 (file)
@@ -913,7 +913,7 @@ static void x_child_init(apr_pool_t *p, server_rec *s)
  * phase.
  */
 #if 0
-static const char *x_http_method(const request_rec *r)
+static const char *x_http_scheme(const request_rec *r)
 {
     x_cfg *cfg;
 
@@ -921,8 +921,8 @@ static const char *x_http_method(const request_rec *r)
     /*
      * Log the call and exit.
      */
-    trace_add(r->server, NULL, cfg, "x_http_method()");
-    return "foo";
+    trace_add(r->server, NULL, cfg, "x_http_scheme()");
+    return "example";
 }
 
 /*
@@ -1285,7 +1285,7 @@ static void x_register_hooks(apr_pool_t *p)
                               APR_HOOK_MIDDLE);
     ap_hook_log_transaction(x_logger, NULL, NULL, APR_HOOK_MIDDLE);
 #if 0
-    ap_hook_http_method(x_http_method, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_http_scheme(x_http_scheme, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_default_port(x_default_port, NULL, NULL, APR_HOOK_MIDDLE);
 #endif
     ap_hook_translate_name(x_translate_handler, NULL, NULL, APR_HOOK_MIDDLE);
index 35fffc86325b01a4e337b96422b1a8974deeb1a4..aa8b454e0076aabc3377449fcda9887840367860 100644 (file)
@@ -249,7 +249,7 @@ static hook_lookup_t request_hooks[] = {
     {"Create Request", ap_hook_get_create_request},
     {"Post-Read Request", ap_hook_get_post_read_request},
     {"Header Parse", ap_hook_get_header_parser},
-    {"HTTP Method", ap_hook_get_http_method},
+    {"HTTP Scheme", ap_hook_get_http_scheme},
     {"Default Port", ap_hook_get_default_port},
     {"Translate Path", ap_hook_get_translate_name},
     {"Map to Storage", ap_hook_get_map_to_storage},
index fabb82ed3e4b3bcb2237c6a90fa661aee7de59cf..773f68fa0d7bd6c9349e05b668b25655572a8f5b 100644 (file)
@@ -95,7 +95,7 @@ static const command_rec http_cmds[] = {
     { NULL }
 };
 
-static const char *http_method(const request_rec *r)
+static const char *http_scheme(const request_rec *r)
 {
     return "http";
 }
@@ -224,7 +224,7 @@ static void register_hooks(apr_pool_t *p)
     }
 
     ap_hook_map_to_storage(ap_send_http_trace,NULL,NULL,APR_HOOK_MIDDLE);
-    ap_hook_http_method(http_method,NULL,NULL,APR_HOOK_REALLY_LAST);
+    ap_hook_http_scheme(http_scheme,NULL,NULL,APR_HOOK_REALLY_LAST);
     ap_hook_default_port(http_port,NULL,NULL,APR_HOOK_REALLY_LAST);
     ap_hook_create_request(http_create_request, NULL, NULL, APR_HOOK_REALLY_LAST);
     ap_http_input_filter_handle =
index 65dc3280d90c3959f65bb1126f9026a0288f04b6..2ef086dcfca79756e32cabe22ea1330032ab6282 100644 (file)
@@ -735,7 +735,7 @@ static void reduce_uri(request_rec *r)
     char *cp;
     apr_size_t l;
 
-    cp = (char *)ap_http_method(r);
+    cp = (char *)ap_http_scheme(r);
     l  = strlen(cp);
     if (   strlen(r->filename) > l+3
         && strncasecmp(r->filename, cp, l) == 0
@@ -807,7 +807,7 @@ static void fully_qualify_uri(request_rec *r)
                    : apr_psprintf(r->pool, ":%u", port);
 
         r->filename = apr_psprintf(r->pool, "%s://%s%s%s%s",
-                                   ap_http_method(r), thisserver, thisport,
+                                   ap_http_scheme(r), thisserver, thisport,
                                    (*r->filename == '/') ? "" : "/",
                                    r->filename);
     }
@@ -4184,7 +4184,7 @@ static int hook_uri2file(request_rec *r)
     thisurl = apr_table_get(r->subprocess_env, ENVVAR_SCRIPT_URL);
 
     /* set the variable */
-    var = apr_pstrcat(r->pool, ap_http_method(r), "://", thisserver, thisport,
+    var = apr_pstrcat(r->pool, ap_http_scheme(r), "://", thisserver, thisport,
                       thisurl, NULL);
     apr_table_setn(r->subprocess_env, ENVVAR_SCRIPT_URI, var);
 
index 84633cc715726f777f4ada486bd1410bb933b1ce..83e87b988038b72dc87f45c1af7dd54232660de2 100644 (file)
@@ -358,7 +358,7 @@ static int proxy_detect(request_rec *r)
     if (conf->req && r->parsed_uri.scheme) {
         /* but it might be something vhosted */
         if (!(r->parsed_uri.hostname
-              && !strcasecmp(r->parsed_uri.scheme, ap_http_method(r))
+              && !strcasecmp(r->parsed_uri.scheme, ap_http_scheme(r))
               && ap_matches_request_vhost(r, r->parsed_uri.hostname,
                                           (apr_port_t)(r->parsed_uri.port_str ? r->parsed_uri.port 
                                                        : ap_default_port(r))))) {
index f676f06e40e4bfef211af11242284af46afdc310..fb9e75bd68cd4dc7408ff4270ea12d715b4eb129 100644 (file)
@@ -396,7 +396,7 @@ int ssl_init_ssl_connection(conn_rec *c)
     return APR_SUCCESS;
 }
 
-static const char *ssl_hook_http_method(const request_rec *r)
+static const char *ssl_hook_http_scheme(const request_rec *r)
 {
     SSLSrvConfigRec *sc = mySrvConfig(r->server);
 
@@ -476,7 +476,7 @@ static void ssl_register_hooks(apr_pool_t *p)
     ap_hook_pre_connection(ssl_hook_pre_connection,NULL,NULL, APR_HOOK_MIDDLE);
     ap_hook_test_config   (ssl_hook_ConfigTest,    NULL,NULL, APR_HOOK_MIDDLE);
     ap_hook_post_config   (ssl_init_Module,        NULL,NULL, APR_HOOK_MIDDLE);
-    ap_hook_http_method   (ssl_hook_http_method,   NULL,NULL, APR_HOOK_MIDDLE);
+    ap_hook_http_scheme   (ssl_hook_http_scheme,   NULL,NULL, APR_HOOK_MIDDLE);
     ap_hook_default_port  (ssl_hook_default_port,  NULL,NULL, APR_HOOK_MIDDLE);
     ap_hook_pre_config    (ssl_hook_pre_config,    NULL,NULL, APR_HOOK_MIDDLE);
     ap_hook_child_init    (ssl_init_Child,         NULL,NULL, APR_HOOK_MIDDLE);
index 98677df5b6347c96adfa1a554b9f194af8ecc1a9..a4f1722063190231d5d929c7893bcbe14a168336 100644 (file)
@@ -117,7 +117,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r,
             if (strcEQ(var, "REQUEST_METHOD")) 
                 result = r->method;
             else if (strcEQ(var, "REQUEST_SCHEME"))
-                result = ap_http_method(r);
+                result = ap_http_scheme(r);
             else if (strcEQ(var, "REQUEST_URI"))
                 result = r->uri;
             else if (strcEQ(var, "REQUEST_FILENAME"))
index 23f47a80864c52861d9c2fd92309f8f36eadc78e..15083f9ff5eea8f500dcf76538989515193dfafa 100644 (file)
@@ -958,10 +958,10 @@ AP_DECLARE(char *) ap_construct_url(apr_pool_t *p, const char *uri,
     const char *host = get_server_name_for_url(r);
 
     if (ap_is_default_port(port, r)) {
-        return apr_pstrcat(p, ap_http_method(r), "://", host, uri, NULL);
+        return apr_pstrcat(p, ap_http_scheme(r), "://", host, uri, NULL);
     }
 
-    return apr_psprintf(p, "%s://%s:%u%s", ap_http_method(r), host, port, uri);
+    return apr_psprintf(p, "%s://%s:%u%s", ap_http_scheme(r), host, port, uri);
 }
 
 AP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r)
index 152f496aec6baf1b5dbd1baeef4697862dd99abd..49fef829bdcc417537c67732346ef96188cd3513 100644 (file)
@@ -60,7 +60,7 @@
 APR_HOOK_STRUCT(
     APR_HOOK_LINK(post_read_request)
     APR_HOOK_LINK(log_transaction)
-    APR_HOOK_LINK(http_method)
+    APR_HOOK_LINK(http_scheme)
     APR_HOOK_LINK(default_port)
 )
 
@@ -503,7 +503,7 @@ AP_CORE_DECLARE(void) ap_parse_uri(request_rec *r, const char *uri)
     if (status == APR_SUCCESS) {
         /* if it has a scheme we may need to do absoluteURI vhost stuff */
         if (r->parsed_uri.scheme
-            && !strcasecmp(r->parsed_uri.scheme, ap_http_method(r))) {
+            && !strcasecmp(r->parsed_uri.scheme, ap_http_scheme(r))) {
             r->hostname = r->parsed_uri.hostname;
         }
         else if (r->method_number == M_CONNECT) {
@@ -1540,7 +1540,7 @@ AP_IMPLEMENT_HOOK_RUN_ALL(int,post_read_request,
                           (request_rec *r), (r), OK, DECLINED)
 AP_IMPLEMENT_HOOK_RUN_ALL(int,log_transaction,
                           (request_rec *r), (r), OK, DECLINED)
-AP_IMPLEMENT_HOOK_RUN_FIRST(const char *,http_method,
+AP_IMPLEMENT_HOOK_RUN_FIRST(const char *,http_scheme,
                             (const request_rec *r), (r), NULL)
 AP_IMPLEMENT_HOOK_RUN_FIRST(unsigned short,default_port,
                             (const request_rec *r), (r), 0)