httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1132781 - in /httpd/httpd/trunk: build/ include/ modules/cache/ modules/echo/ modules/experimental/ modules/filters/ modules/generators/ modules/http/ modules/proxy/ modules/test/ os/netware/ os/win32/ server/ server/mpm/prefork/ server/mp...
Date Mon, 06 Jun 2011 21:26:58 GMT
Author: sf
Date: Mon Jun  6 21:26:56 2011
New Revision: 1132781

URL: http://svn.apache.org/viewvc?rev=1132781&view=rev
Log:
Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.

Modified:
    httpd/httpd/trunk/build/build-modules-c.awk
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/include/http_core.h
    httpd/httpd/trunk/modules/cache/mod_cache_disk.c
    httpd/httpd/trunk/modules/echo/mod_echo.c
    httpd/httpd/trunk/modules/experimental/mod_noloris.c
    httpd/httpd/trunk/modules/filters/mod_ext_filter.c
    httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
    httpd/httpd/trunk/modules/generators/mod_cgi.c
    httpd/httpd/trunk/modules/generators/mod_cgid.c
    httpd/httpd/trunk/modules/http/http_core.c
    httpd/httpd/trunk/modules/http/http_etag.c
    httpd/httpd/trunk/modules/http/http_filters.c
    httpd/httpd/trunk/modules/http/http_protocol.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c
    httpd/httpd/trunk/modules/test/mod_dialup.c
    httpd/httpd/trunk/os/netware/modules.c
    httpd/httpd/trunk/os/win32/modules.c
    httpd/httpd/trunk/server/config.c
    httpd/httpd/trunk/server/connection.c
    httpd/httpd/trunk/server/core.c
    httpd/httpd/trunk/server/core_filters.c
    httpd/httpd/trunk/server/listen.c
    httpd/httpd/trunk/server/log.c
    httpd/httpd/trunk/server/mpm/prefork/prefork.c
    httpd/httpd/trunk/server/mpm/winnt/child.c
    httpd/httpd/trunk/server/mpm_common.c
    httpd/httpd/trunk/server/mpm_unix.c
    httpd/httpd/trunk/server/protocol.c
    httpd/httpd/trunk/server/request.c
    httpd/httpd/trunk/server/scoreboard.c
    httpd/httpd/trunk/server/util.c
    httpd/httpd/trunk/server/util_cookies.c
    httpd/httpd/trunk/server/util_debug.c
    httpd/httpd/trunk/server/util_ebcdic.c
    httpd/httpd/trunk/server/util_expr_eval.c
    httpd/httpd/trunk/server/util_filter.c
    httpd/httpd/trunk/server/util_mutex.c
    httpd/httpd/trunk/server/util_script.c
    httpd/httpd/trunk/server/util_xml.c
    httpd/httpd/trunk/server/vhost.c

Modified: httpd/httpd/trunk/build/build-modules-c.awk
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/build/build-modules-c.awk?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/build/build-modules-c.awk (original)
+++ httpd/httpd/trunk/build/build-modules-c.awk Mon Jun  6 21:26:56 2011
@@ -14,6 +14,7 @@
 # limitations under the License.
 BEGIN {
     RS = " "
+    # the core module must come first
     modules[n++] = "core"
     pmodules[pn++] = "core"
 } 

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Mon Jun  6 21:26:56 2011
@@ -331,6 +331,7 @@
  *                         Add members of core_request_config: document_root,
  *                         context_document_root, context_prefix.
  *                         Add ap_context_*(), ap_set_context_info(), ap_set_document_root()
+ * 20110605.1 (2.3.13-dev) add ap_(get|set)_core_module_config()
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
@@ -338,7 +339,7 @@
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20110605
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 0                    /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1                    /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a

Modified: httpd/httpd/trunk/include/http_core.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_core.h?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_core.h (original)
+++ httpd/httpd/trunk/include/http_core.h Mon Jun  6 21:26:56 2011
@@ -319,6 +319,34 @@ AP_DECLARE(int) ap_satisfies(request_rec
 AP_DECLARE_DATA extern module core_module;
 
 /**
+ * Accessor for core_module's specific data. Equivalent to
+ * ap_get_module_config(cv, &core_module) but more efficient.
+ * @param cv The vector in which the modules configuration is stored.
+ *        usually r->per_dir_config or s->module_config
+ * @return The module-specific data
+ */
+AP_DECLARE(void *) ap_get_core_module_config(const ap_conf_vector_t *cv);
+
+/**
+ * Accessor to set core_module's specific data. Equivalent to
+ * ap_set_module_config(cv, &core_module, val) but more efficient.
+ * @param cv The vector in which the modules configuration is stored.
+ *        usually r->per_dir_config or s->module_config
+ * @param val The module-specific data to set
+ */
+AP_DECLARE(void) ap_set_core_module_config(ap_conf_vector_t *cv, void *val);
+
+#ifndef AP_DEBUG
+#define AP_CORE_MODULE_INDEX  0
+#define ap_get_core_module_config(v) \
+    (((void **)(v))[AP_CORE_MODULE_INDEX])
+#define ap_set_core_module_config(v, val) \
+    ((((void **)(v))[AP_CORE_MODULE_INDEX]) = (val))
+#else
+#define AP_CORE_MODULE_INDEX  (AP_DEBUG_ASSERT(core_module.module_index == 0), 0)
+#endif
+
+/**
  * @brief  Per-request configuration 
 */
 typedef struct {

Modified: httpd/httpd/trunk/modules/cache/mod_cache_disk.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_cache_disk.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache_disk.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_cache_disk.c Mon Jun  6 21:26:56 2011
@@ -409,8 +409,7 @@ static int open_entity(cache_handle_t *h
     disk_cache_conf *conf = ap_get_module_config(r->server->module_config,
                                                  &cache_disk_module);
 #ifdef APR_SENDFILE_ENABLED
-    core_dir_config *coreconf = ap_get_module_config(r->per_dir_config,
-                                                     &core_module);
+    core_dir_config *coreconf = ap_get_core_module_config(r->per_dir_config);
 #endif
     apr_finfo_t finfo;
     cache_object_t *obj;

Modified: httpd/httpd/trunk/modules/echo/mod_echo.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/echo/mod_echo.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/echo/mod_echo.c (original)
+++ httpd/httpd/trunk/modules/echo/mod_echo.c Mon Jun  6 21:26:56 2011
@@ -168,7 +168,7 @@ static int process_echo_connection(conn_
         }
 
         if (!csd) {
-            csd = ap_get_module_config(c->conn_config, &core_module);
+            csd = ap_get_core_module_config(c->conn_config);
             apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
         }
 

Modified: httpd/httpd/trunk/modules/experimental/mod_noloris.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/experimental/mod_noloris.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/experimental/mod_noloris.c (original)
+++ httpd/httpd/trunk/modules/experimental/mod_noloris.c Mon Jun  6 21:26:56 2011
@@ -35,6 +35,7 @@
 
 #include "httpd.h"
 #include "http_config.h"
+#include "http_core.h"
 #include "http_connection.h"
 #include "http_log.h"
 #include "mpm_common.h"
@@ -43,7 +44,6 @@
 #include "scoreboard.h"
 
 module AP_MODULE_DECLARE_DATA noloris_module;
-module AP_MODULE_DECLARE_DATA core_module;
 
 #define ADDR_MAX_SIZE 48
 
@@ -68,7 +68,7 @@ static int noloris_conn(conn_rec *conn)
     shm_rec = apr_shm_baseaddr_get(shm);
     while (shm_rec[0] != '\0') {
         if (!strcmp(shm_rec, conn->remote_ip)) {
-            apr_socket_t *csd = ap_get_module_config(conn->conn_config, &core_module);
+            apr_socket_t *csd = ap_get_core_module_config(conn->conn_config);
             ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, conn,
                           "Dropping connection from banned IP %s",
                           conn->remote_ip);

Modified: httpd/httpd/trunk/modules/filters/mod_ext_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_ext_filter.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_ext_filter.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_ext_filter.c Mon Jun  6 21:26:56 2011
@@ -365,8 +365,7 @@ static apr_status_t set_resource_limits(
 #if defined(RLIMIT_CPU)  || defined(RLIMIT_NPROC) || \
     defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
     core_dir_config *conf =
-        (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                &core_module);
+        (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
     apr_status_t rv;
 
 #ifdef RLIMIT_CPU

Modified: httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_reqtimeout.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Mon Jun  6 21:26:56 2011
@@ -186,7 +186,7 @@ static apr_status_t reqtimeout_filter(ap
     }
 
     if (!ccfg->socket) {
-        ccfg->socket = ap_get_module_config(f->c->conn_config, &core_module);
+        ccfg->socket = ap_get_core_module_config(f->c->conn_config);
     }
 
     rv = check_time_left(ccfg, &time_left);

Modified: httpd/httpd/trunk/modules/generators/mod_cgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_cgi.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_cgi.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_cgi.c Mon Jun  6 21:26:56 2011
@@ -385,8 +385,7 @@ static apr_status_t run_cgi_child(apr_fi
 #if defined(RLIMIT_CPU)  || defined(RLIMIT_NPROC) || \
     defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
 
-    core_dir_config *conf = ap_get_module_config(r->per_dir_config,
-                                                 &core_module);
+    core_dir_config *conf = ap_get_core_module_config(r->per_dir_config);
 #endif
 
 #ifdef DEBUG_CGI

Modified: httpd/httpd/trunk/modules/generators/mod_cgid.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_cgid.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_cgid.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_cgid.c Mon Jun  6 21:26:56 2011
@@ -195,7 +195,6 @@ typedef struct {
     pid_t ppid;            /* sanity check for config problems leading to
                             * wrong cgid socket use
                             */
-    int core_module_index;
     int env_count;
     ap_unix_identity_t ugid;
     apr_size_t filename_len;
@@ -424,7 +423,7 @@ static apr_status_t get_req(int fd, requ
     rconf = (void **)ap_create_request_config(r->pool);
 
     temp_core = (core_request_config *)apr_palloc(r->pool, sizeof(core_module));
-    rconf[req->core_module_index] = (void *)temp_core;
+    rconf[AP_CORE_MODULE_INDEX] = (void *)temp_core;
     r->request_config = (ap_conf_vector_t *)rconf;
     ap_set_module_config(r->request_config, &cgid_module, (void *)&req->ugid);
 
@@ -475,8 +474,7 @@ static apr_status_t send_req(int fd, req
     cgid_req_t req = {0};
     apr_status_t stat;
     ap_unix_identity_t * ugid = ap_run_get_suexec_identity(r);
-    core_dir_config *core_conf = ap_get_module_config(r->per_dir_config,
-                                                      &core_module);
+    core_dir_config *core_conf = ap_get_core_module_config(r->per_dir_config);
 
 
     if (ugid == NULL) {
@@ -488,7 +486,6 @@ static apr_status_t send_req(int fd, req
     req.req_type = req_type;
     req.ppid = parent_pid;
     req.conn_id = r->connection->id;
-    req.core_module_index = core_module.module_index;
     for (req.env_count = 0; env[req.env_count]; req.env_count++) {
         continue;
     }

Modified: httpd/httpd/trunk/modules/http/http_core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_core.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_core.c (original)
+++ httpd/httpd/trunk/modules/http/http_core.c Mon Jun  6 21:26:56 2011
@@ -208,7 +208,7 @@ static int ap_process_http_sync_connecti
         }
 
         if (!csd) {
-            csd = ap_get_module_config(c->conn_config, &core_module);
+            csd = ap_get_core_module_config(c->conn_config);
         }
         apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
         apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);

Modified: httpd/httpd/trunk/modules/http/http_etag.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_etag.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_etag.c (original)
+++ httpd/httpd/trunk/modules/http/http_etag.c Mon Jun  6 21:26:56 2011
@@ -70,8 +70,7 @@ AP_DECLARE(char *) ap_make_etag(request_
     etag_components_t etag_bits;
     etag_components_t bits_added;
 
-    cfg = (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                  &core_module);
+    cfg = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
     etag_bits = (cfg->etag_bits & (~ cfg->etag_remove)) | cfg->etag_add;
 
     /*

Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Mon Jun  6 21:26:56 2011
@@ -1033,8 +1033,7 @@ AP_DECLARE_NONSTD(int) ap_send_http_trac
     while (r->prev) {
         r = r->prev;
     }
-    conf = (core_server_config *)ap_get_module_config(r->server->module_config,
-                                                      &core_module);
+    conf = ap_get_core_module_config(r->server->module_config);
 
     if (conf->trace_enable == AP_TRACE_DISABLE) {
         apr_table_setn(r->notes, "error-notes",
@@ -1520,8 +1519,7 @@ AP_DECLARE(int) ap_setup_client_block(re
     {
         /* Make sure ap_getline() didn't leave any droppings. */
         core_request_config *req_cfg =
-            (core_request_config *)ap_get_module_config(r->request_config,
-                                                        &core_module);
+            (core_request_config *)ap_get_core_module_config(r->request_config);
         AP_DEBUG_ASSERT(APR_BRIGADE_EMPTY(req_cfg->bb));
     }
 #endif

Modified: httpd/httpd/trunk/modules/http/http_protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_protocol.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_protocol.c (original)
+++ httpd/httpd/trunk/modules/http/http_protocol.c Mon Jun  6 21:26:56 2011
@@ -781,7 +781,7 @@ static char *make_allow(request_rec *r)
     apr_hash_index_t *hi = apr_hash_first(r->pool, methods_registry);
     /* For TRACE below */
     core_server_config *conf =
-        ap_get_module_config(r->server->module_config, &core_module);
+        ap_get_core_module_config(r->server->module_config);
 
     mask = r->allowed_methods->method_mask;
 
@@ -1186,7 +1186,7 @@ AP_DECLARE(void) ap_send_error_response(
         if (apr_table_get(r->subprocess_env,
                           "suppress-error-charset") != NULL) {
             core_request_config *request_conf =
-                        ap_get_module_config(r->request_config, &core_module);
+                        ap_get_core_module_config(r->request_config);
             request_conf->suppress_charset = 1; /* avoid adding default
                                                  * charset later
                                                  */

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Mon Jun  6 21:26:56 2011
@@ -886,7 +886,7 @@ static int proxy_handler(request_rec *r)
 
     if (r->method_number == M_TRACE) {
         core_server_config *coreconf = (core_server_config *)
-                            ap_get_module_config(sconf, &core_module);
+                                       ap_get_core_module_config(sconf);
 
         if (coreconf->trace_enable == AP_TRACE_DISABLE)
         {

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c Mon Jun  6 21:26:56 2011
@@ -209,7 +209,7 @@ static int proxy_connect_handler(request
     apr_status_t err, rv;
     apr_size_t nbytes;
     char buffer[HUGE_STRING_LEN];
-    apr_socket_t *client_socket = ap_get_module_config(c->conn_config, &core_module);
+    apr_socket_t *client_socket = ap_get_core_module_config(c->conn_config);
     int failed, rc;
     int client_error = 0;
     apr_pollset_t *pollset;

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c Mon Jun  6 21:26:56 2011
@@ -223,7 +223,7 @@ static int proxy_fdpass_handler(request_
 
     /* XXXXX: THIS IS AN EVIL HACK */
     /* There should really be a (documented) public API for this ! */
-    clientsock = ap_get_module_config(r->connection->conn_config, &core_module);
+    clientsock = ap_get_core_module_config(r->connection->conn_config);
 
     rv = send_socket(r->pool, sock, clientsock);
     if (rv != APR_SUCCESS) {
@@ -245,7 +245,7 @@ static int proxy_fdpass_handler(request_
                           "proxy: FD: failed to create dummy socket");
             return HTTP_INTERNAL_SERVER_ERROR;
         }
-        ap_set_module_config(r->connection->conn_config, &core_module, dummy);
+        ap_set_core_module_config(r->connection->conn_config, dummy);
     }
     
     

Modified: httpd/httpd/trunk/modules/test/mod_dialup.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/test/mod_dialup.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/test/mod_dialup.c (original)
+++ httpd/httpd/trunk/modules/test/mod_dialup.c Mon Jun  6 21:26:56 2011
@@ -155,8 +155,7 @@ dialup_handler(request_rec *r)
         return DECLINED;
     }
 
-    ccfg = ap_get_module_config(r->per_dir_config,
-                                &core_module);
+    ccfg = ap_get_core_module_config(r->per_dir_config);
 
 
     rv = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY

Modified: httpd/httpd/trunk/os/netware/modules.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/os/netware/modules.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/os/netware/modules.c (original)
+++ httpd/httpd/trunk/os/netware/modules.c Mon Jun  6 21:26:56 2011
@@ -45,7 +45,7 @@ extern module nwssl_module;
 extern module netware_module;
 
 module *ap_prelinked_modules[] = {
-  &core_module,
+  &core_module, /* core must come first */
   &mpm_netware_module,
   &http_module,
   &so_module,

Modified: httpd/httpd/trunk/os/win32/modules.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/os/win32/modules.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/os/win32/modules.c (original)
+++ httpd/httpd/trunk/os/win32/modules.c Mon Jun  6 21:26:56 2011
@@ -29,7 +29,7 @@ extern module http_module;
 extern module so_module;
 
 AP_DECLARE_DATA module *ap_prelinked_modules[] = {
-  &core_module,
+  &core_module, /* core must come first */
   &win32_module,
   &mpm_winnt_module,
   &http_module,

Modified: httpd/httpd/trunk/server/config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/config.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/config.c (original)
+++ httpd/httpd/trunk/server/config.c Mon Jun  6 21:26:56 2011
@@ -52,7 +52,9 @@
 #include "mpm_common.h"
 
 #define APLOG_UNSET   (APLOG_NO_MODULE - 1)
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 AP_DECLARE_DATA const char *ap_server_argv0 = NULL;
 AP_DECLARE_DATA const char *ap_server_root = NULL;
@@ -2178,8 +2180,8 @@ AP_DECLARE(void) ap_merge_log_config(con
 AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server)
 {
     server_rec *virt;
-    core_dir_config *dconf = ap_get_module_config(main_server->lookup_defaults,
-                                                  &core_module);
+    core_dir_config *dconf =
+        ap_get_core_module_config(main_server->lookup_defaults);
     dconf->log = &main_server->log;
 
     for (virt = main_server->next; virt; virt = virt->next) {
@@ -2207,7 +2209,7 @@ AP_DECLARE(void) ap_fixup_virtual_hosts(
 
         ap_merge_log_config(&main_server->log, &virt->log);
 
-        dconf = ap_get_module_config(virt->lookup_defaults, &core_module);
+        dconf = ap_get_core_module_config(virt->lookup_defaults);
         dconf->log = &virt->log;
 
         /* XXX: this is really something that should be dealt with by a

Modified: httpd/httpd/trunk/server/connection.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/connection.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/connection.c (original)
+++ httpd/httpd/trunk/server/connection.c Mon Jun  6 21:26:56 2011
@@ -98,7 +98,7 @@ AP_DECLARE(void) ap_lingering_close(conn
     char dummybuf[512];
     apr_size_t nbytes;
     apr_time_t timeup = 0;
-    apr_socket_t *csd = ap_get_module_config(c->conn_config, &core_module);
+    apr_socket_t *csd = ap_get_core_module_config(c->conn_config);
 
     if (!csd) {
         return;

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Mon Jun  6 21:26:56 2011
@@ -98,6 +98,10 @@ AP_IMPLEMENT_HOOK_RUN_ALL(int, get_mgmt_
  * the http_conf_globals.
  */
 
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
+
 /* Handles for core filters */
 AP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle;
 AP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle;
@@ -507,8 +511,7 @@ static void *merge_core_server_configs(a
 
 AP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config)
 {
-    core_server_config *sconf = ap_get_module_config(s->module_config,
-                                                     &core_module);
+    core_server_config *sconf = ap_get_core_module_config(s->module_config);
     void **new_space = (void **)apr_array_push(sconf->sec_dir);
 
     *new_space = dir_config;
@@ -516,8 +519,7 @@ AP_CORE_DECLARE(void) ap_add_per_dir_con
 
 AP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config)
 {
-    core_server_config *sconf = ap_get_module_config(s->module_config,
-                                                     &core_module);
+    core_server_config *sconf = ap_get_core_module_config(s->module_config);
     void **new_space = (void **)apr_array_push(sconf->sec_url);
 
     *new_space = url_config;
@@ -584,8 +586,8 @@ static int reorder_sorter(const void *va
     core_dir_config *core_a;
     core_dir_config *core_b;
 
-    core_a = ap_get_module_config(a->elt, &core_module);
-    core_b = ap_get_module_config(b->elt, &core_module);
+    core_a = ap_get_core_module_config(a->elt);
+    core_b = ap_get_core_module_config(b->elt);
 
     /* a regex always sorts after a non-regex
      */
@@ -621,7 +623,7 @@ void ap_core_reorder_directories(apr_poo
     int i;
     apr_pool_t *tmp;
 
-    sconf = ap_get_module_config(s->module_config, &core_module);
+    sconf = ap_get_core_module_config(s->module_config);
     sec_dir = sconf->sec_dir;
     nelts = sec_dir->nelts;
     elts = (ap_conf_vector_t **)sec_dir->elts;
@@ -664,7 +666,7 @@ void ap_core_reorder_directories(apr_poo
 AP_DECLARE(int) ap_allow_options(request_rec *r)
 {
     core_dir_config *conf =
-      (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
+      (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
 
     return conf->opts;
 }
@@ -672,8 +674,7 @@ AP_DECLARE(int) ap_allow_options(request
 AP_DECLARE(int) ap_allow_overrides(request_rec *r)
 {
     core_dir_config *conf;
-    conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                   &core_module);
+    conf = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
 
     return conf->override;
 }
@@ -723,18 +724,16 @@ AP_DECLARE(int) ap_satisfies(request_rec
 AP_DECLARE(const char *) ap_document_root(request_rec *r) /* Don't use this! */
 {
     core_server_config *sconf;
-    core_request_config *rconf = ap_get_module_config(r->request_config,
-                                                     &core_module);
+    core_request_config *rconf = ap_get_core_module_config(r->request_config);
     if (rconf->document_root)
         return rconf->document_root;
-    sconf = ap_get_module_config(r->server->module_config, &core_module);
+    sconf = ap_get_core_module_config(r->server->module_config);
     return sconf->ap_document_root;
 }
 
 AP_DECLARE(const char *) ap_context_prefix(request_rec *r)
 {
-    core_request_config *conf = ap_get_module_config(r->request_config,
-                                                     &core_module);
+    core_request_config *conf = ap_get_core_module_config(r->request_config);
     if (conf->context_prefix)
         return conf->context_prefix;
     else
@@ -743,8 +742,7 @@ AP_DECLARE(const char *) ap_context_pref
 
 AP_DECLARE(const char *) ap_context_document_root(request_rec *r)
 {
-    core_request_config *conf = ap_get_module_config(r->request_config,
-                                                     &core_module);
+    core_request_config *conf = ap_get_core_module_config(r->request_config);
     if (conf->context_document_root)
         return conf->context_document_root;
     else
@@ -753,16 +751,14 @@ AP_DECLARE(const char *) ap_context_docu
 
 AP_DECLARE(void) ap_set_document_root(request_rec *r, const char *document_root)
 {
-    core_request_config *conf = ap_get_module_config(r->request_config,
-                                                     &core_module);
+    core_request_config *conf = ap_get_core_module_config(r->request_config);
     conf->document_root = document_root;
 }
 
 AP_DECLARE(void) ap_set_context_info(request_rec *r, const char *context_prefix,
                                      const char *context_document_root)
 {
-    core_request_config *conf = ap_get_module_config(r->request_config,
-                                                     &core_module);
+    core_request_config *conf = ap_get_core_module_config(r->request_config);
     if (context_prefix)
         conf->context_prefix = context_prefix;
     if (context_document_root)
@@ -777,19 +773,16 @@ AP_DECLARE(void) ap_set_context_info(req
 char *ap_response_code_string(request_rec *r, int error_index)
 {
     core_dir_config *dirconf;
-    core_request_config *reqconf;
+    core_request_config *reqconf = ap_get_core_module_config(r->request_config);
 
     /* check for string registered via ap_custom_response() first */
-    reqconf = (core_request_config *)ap_get_module_config(r->request_config,
-                                                          &core_module);
     if (reqconf->response_code_strings != NULL &&
         reqconf->response_code_strings[error_index] != NULL) {
         return reqconf->response_code_strings[error_index];
     }
 
     /* check for string specified via ErrorDocument */
-    dirconf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                      &core_module);
+    dirconf = ap_get_core_module_config(r->per_dir_config);
 
     if (dirconf->response_code_strings == NULL) {
         return NULL;
@@ -848,9 +841,8 @@ AP_DECLARE(const char *) ap_get_remote_h
 
     /* If we haven't checked the host name, and we want to */
     if (dir_config) {
-        hostname_lookups =
-            ((core_dir_config *)ap_get_module_config(dir_config, &core_module))
-            ->hostname_lookups;
+        hostname_lookups = ((core_dir_config *)ap_get_core_module_config(dir_config))
+                           ->hostname_lookups;
 
         if (hostname_lookups == HOSTNAME_LOOKUP_UNSET) {
             hostname_lookups = HOSTNAME_LOOKUP_OFF;
@@ -945,8 +937,7 @@ AP_DECLARE(const char *) ap_get_server_n
     core_dir_config *d;
     const char *retval;
 
-    d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                &core_module);
+    d = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
 
     switch (d->use_canonical_name) {
         case USE_CANONICAL_NAME_ON:
@@ -998,7 +989,7 @@ AP_DECLARE(apr_port_t) ap_get_server_por
 {
     apr_port_t port;
     core_dir_config *d =
-      (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
+      (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
 
     switch (d->use_canonical_name) {
         case USE_CANONICAL_NAME_OFF:
@@ -1057,7 +1048,7 @@ AP_DECLARE(char *) ap_construct_url(apr_
 AP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r)
 {
     core_dir_config *d =
-      (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
+      (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
 
     if (d->limit_req_body == AP_LIMIT_REQ_BODY_UNSET) {
         return AP_DEFAULT_LIMIT_REQ_BODY;
@@ -1144,7 +1135,7 @@ static const char *set_access_name(cmd_p
                                    const char *arg)
 {
     void *sconf = cmd->server->module_config;
-    core_server_config *conf = ap_get_module_config(sconf, &core_module);
+    core_server_config *conf = ap_get_core_module_config(sconf);
 
     const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
     if (err != NULL) {
@@ -1340,7 +1331,7 @@ static const char *generate_error(cmd_pa
 static const char *set_gprof_dir(cmd_parms *cmd, void *dummy, const char *arg)
 {
     void *sconf = cmd->server->module_config;
-    core_server_config *conf = ap_get_module_config(sconf, &core_module);
+    core_server_config *conf = ap_get_core_module_config(sconf);
 
     const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
     if (err != NULL) {
@@ -1376,7 +1367,7 @@ static const char *set_document_root(cmd
                                      const char *arg)
 {
     void *sconf = cmd->server->module_config;
-    core_server_config *conf = ap_get_module_config(sconf, &core_module);
+    core_server_config *conf = ap_get_core_module_config(sconf);
 
     const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
     if (err != NULL) {
@@ -1416,8 +1407,7 @@ static const char *set_document_root(cmd
 AP_DECLARE(void) ap_custom_response(request_rec *r, int status,
                                     const char *string)
 {
-    core_request_config *conf =
-        ap_get_module_config(r->request_config, &core_module);
+    core_request_config *conf = ap_get_core_module_config(r->request_config);
     int idx;
 
     if (conf->response_code_strings == NULL) {
@@ -2545,8 +2535,8 @@ static const char *set_accf_map(cmd_parm
                                 const char *iproto, const char* iaccf)
 {
     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-    core_server_config *conf = ap_get_module_config(cmd->server->module_config,
-                                                    &core_module);
+    core_server_config *conf =
+        ap_get_core_module_config(cmd->server->module_config);
     char* proto;
     char* accf;
     if (err != NULL) {
@@ -2564,15 +2554,13 @@ static const char *set_accf_map(cmd_parm
 
 AP_DECLARE(const char*) ap_get_server_protocol(server_rec* s)
 {
-    core_server_config *conf = ap_get_module_config(s->module_config,
-                                                    &core_module);
+    core_server_config *conf = ap_get_core_module_config(s->module_config);
     return conf->protocol;
 }
 
 AP_DECLARE(void) ap_set_server_protocol(server_rec* s, const char* proto)
 {
-    core_server_config *conf = ap_get_module_config(s->module_config,
-                                                    &core_module);
+    core_server_config *conf = ap_get_core_module_config(s->module_config);
     conf->protocol = proto;
 }
 
@@ -2580,8 +2568,8 @@ static const char *set_protocol(cmd_parm
                                 const char *arg)
 {
     const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
-    core_server_config *conf = ap_get_module_config(cmd->server->module_config,
-                                                    &core_module);
+    core_server_config *conf =
+        ap_get_core_module_config(cmd->server->module_config);
     char* proto;
 
     if (err != NULL) {
@@ -2970,8 +2958,7 @@ AP_DECLARE(const char *) ap_psignature(c
     char sport[20];
     core_dir_config *conf;
 
-    conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                   &core_module);
+    conf = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
     if ((conf->server_signature == srv_sig_off)
             || (conf->server_signature == srv_sig_unset)) {
         return "";
@@ -3231,7 +3218,7 @@ AP_DECLARE(size_t) ap_get_limit_xml_body
 {
     core_dir_config *conf;
 
-    conf = ap_get_module_config(r->per_dir_config, &core_module);
+    conf = ap_get_core_module_config(r->per_dir_config);
     if (conf->limit_xml_body == AP_LIMIT_UNSET)
         return AP_DEFAULT_LIMIT_XML_BODY;
 
@@ -3292,8 +3279,8 @@ static const char *set_limit_nproc(cmd_p
 static const char *set_recursion_limit(cmd_parms *cmd, void *dummy,
                                        const char *arg1, const char *arg2)
 {
-    core_server_config *conf = ap_get_module_config(cmd->server->module_config,
-                                                    &core_module);
+    core_server_config *conf =
+        ap_get_core_module_config(cmd->server->module_config);
     int limit = atoi(arg1);
 
     if (limit <= 0) {
@@ -3354,8 +3341,8 @@ static void log_backtrace(const request_
  */
 AP_DECLARE(int) ap_is_recursion_limit_exceeded(const request_rec *r)
 {
-    core_server_config *conf = ap_get_module_config(r->server->module_config,
-                                                    &core_module);
+    core_server_config *conf =
+        ap_get_core_module_config(r->server->module_config);
     const request_rec *top = r;
     int redirects = 0, subreqs = 0;
     int rlimit = conf->redirect_limit
@@ -3415,8 +3402,8 @@ AP_DECLARE(int) ap_is_recursion_limit_ex
 static const char *set_trace_enable(cmd_parms *cmd, void *dummy,
                                     const char *arg1)
 {
-    core_server_config *conf = ap_get_module_config(cmd->server->module_config,
-                                                    &core_module);
+    core_server_config *conf =
+        ap_get_core_module_config(cmd->server->module_config);
 
     if (strcasecmp(arg1, "on") == 0) {
         conf->trace_enable = AP_TRACE_ENABLE;
@@ -3636,8 +3623,8 @@ static const char *set_errorlog_format(c
                                        const char *arg1, const char *arg2)
 {
     const char *err_string = NULL;
-    core_server_config *conf = ap_get_module_config(cmd->server->module_config,
-                                                    &core_module);
+    core_server_config *conf =
+        ap_get_core_module_config(cmd->server->module_config);
 
     if (!arg2) {
         conf->error_log_format = parse_errorlog_string(cmd->pool, arg1,
@@ -3930,7 +3917,7 @@ AP_INIT_TAKE1("TraceEnable", set_trace_e
 AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r)
 {
     void *sconf = r->server->module_config;
-    core_server_config *conf = ap_get_module_config(sconf, &core_module);
+    core_server_config *conf = ap_get_core_module_config(sconf);
     apr_status_t rv;
 
     /* XXX this seems too specific, this should probably become
@@ -4021,8 +4008,7 @@ static int do_nothing(request_rec *r) { 
 static int core_override_type(request_rec *r)
 {
     core_dir_config *conf =
-        (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                &core_module);
+        (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
 
     /* Check for overrides with ForceType / SetHandler
      */
@@ -4070,8 +4056,7 @@ static int default_handler(request_rec *
      */
     int bld_content_md5;
 
-    d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                &core_module);
+    d = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
     bld_content_md5 = (d->content_md5 == AP_CONTENT_MD5_ON)
                       && r->output_filters->frec->ftype != AP_FTYPE_RESOURCE;
 
@@ -4123,7 +4108,7 @@ static int default_handler(request_rec *
         if (r->method_number != M_GET) {
             core_request_config *req_cfg;
 
-            req_cfg = ap_get_module_config(r->request_config, &core_module);
+            req_cfg = ap_get_core_module_config(r->request_config);
             if (!req_cfg->deliver_script) {
                 /* The flag hasn't been set for this request. Punt. */
                 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
@@ -4267,8 +4252,7 @@ static int core_post_config(apr_pool_t *
 static void core_insert_filter(request_rec *r)
 {
     core_dir_config *conf = (core_dir_config *)
-                            ap_get_module_config(r->per_dir_config,
-                                                 &core_module);
+                            ap_get_core_module_config(r->per_dir_config);
     const char *filter, *filters = conf->output_filters;
 
     if (filters) {
@@ -4309,7 +4293,7 @@ AP_DECLARE(void **) ap_get_request_note(
     }
 
     req_cfg = (core_request_config *)
-        ap_get_module_config(r->request_config, &core_module);
+        ap_get_core_module_config(r->request_config);
 
     if (!req_cfg) {
         return NULL;
@@ -4334,14 +4318,14 @@ static int core_create_req(request_rec *
 
     if (r->main) {
         core_request_config *main_req_cfg = (core_request_config *)
-            ap_get_module_config(r->main->request_config, &core_module);
+            ap_get_core_module_config(r->main->request_config);
         req_cfg->bb = main_req_cfg->bb;
     }
     else {
         req_cfg->bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
     }
 
-    ap_set_module_config(r->request_config, &core_module, req_cfg);
+    ap_set_core_module_config(r->request_config, req_cfg);
 
     return OK;
 }
@@ -4442,7 +4426,7 @@ static int core_pre_connection(conn_rec 
     net->out_ctx = NULL;
     net->client_socket = csd;
 
-    ap_set_module_config(net->c->conn_config, &core_module, csd);
+    ap_set_core_module_config(net->c->conn_config, csd);
     ap_add_input_filter_handle(ap_core_input_filter_handle, net, NULL, net->c);
     ap_add_output_filter_handle(ap_core_output_filter_handle, net, NULL, net->c);
     return DONE;

Modified: httpd/httpd/trunk/server/core_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core_filters.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core_filters.c (original)
+++ httpd/httpd/trunk/server/core_filters.c Mon Jun  6 21:26:56 2011
@@ -74,7 +74,9 @@ do { \
     } while (!APR_BRIGADE_EMPTY(b) && (e != APR_BRIGADE_SENTINEL(b))); \
 } while (0)
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
                          ap_input_mode_t mode, apr_read_type_e block,

Modified: httpd/httpd/trunk/server/listen.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/listen.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/listen.c (original)
+++ httpd/httpd/trunk/server/listen.c Mon Jun  6 21:26:56 2011
@@ -28,7 +28,9 @@
 #include "http_log.h"
 #include "mpm_common.h"
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 AP_DECLARE_DATA ap_listen_rec *ap_listeners = NULL;
 
@@ -178,8 +180,7 @@ static apr_status_t make_sock(apr_pool_t
 static const char* find_accf_name(server_rec *s, const char *proto)
 {
     const char* accf;
-    core_server_config *conf = ap_get_module_config(s->module_config,
-                                                    &core_module);
+    core_server_config *conf = ap_get_core_module_config(s->module_config);
     if (!proto) {
         return NULL;
     }

Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Mon Jun  6 21:26:56 2011
@@ -54,7 +54,9 @@
 #include "util_time.h"
 #include "ap_mpm.h"
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 typedef struct {
     const char *t_name;
@@ -1133,7 +1135,7 @@ static void log_error_core(const char *f
 
         /* the faked server_rec from mod_cgid does not have s->module_config */
         if (s->module_config) {
-            sconf = ap_get_module_config(s->module_config, &core_module);
+            sconf = ap_get_core_module_config(s->module_config);
             if (c && !c->log_id) {
                 add_log_id(c, NULL);
                 if (sconf->error_log_conn && sconf->error_log_conn->nelts > 0)

Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original)
+++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Mon Jun  6 21:26:56 2011
@@ -157,7 +157,7 @@ static int my_child_num;
 static void chdir_for_gprof(void)
 {
     core_server_config *sconf =
-        ap_get_module_config(ap_server_conf->module_config, &core_module);
+        ap_get_core_module_config(ap_server_conf->module_config);
     char *dir = sconf->gprof_dir;
     const char *use_dir;
 

Modified: httpd/httpd/trunk/server/mpm/winnt/child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/child.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/child.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/child.c Mon Jun  6 21:26:56 2011
@@ -293,8 +293,7 @@ static unsigned int __stdcall winnt_acce
 #endif
     u_long zero = 0;
 
-    core_sconf = ap_get_module_config(ap_server_conf->module_config,
-                                      &core_module);
+    core_sconf = ap_get_core_module_config(ap_server_conf->module_config);
     accf_name = apr_table_get(core_sconf->accf_map, lr->protocol);
 
     if (strcmp(accf_name, "data") == 0)

Modified: httpd/httpd/trunk/server/mpm_common.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_common.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_common.c (original)
+++ httpd/httpd/trunk/server/mpm_common.c Mon Jun  6 21:26:56 2011
@@ -37,6 +37,7 @@
 
 #include "httpd.h"
 #include "http_config.h"
+#include "http_core.h"
 #include "http_log.h"
 #include "http_main.h"
 #include "mpm_common.h"
@@ -56,7 +57,9 @@
 #include <unistd.h>
 #endif
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 #if AP_ENABLE_EXCEPTION_HOOK
 APR_HOOK_STRUCT(

Modified: httpd/httpd/trunk/server/mpm_unix.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_unix.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_unix.c (original)
+++ httpd/httpd/trunk/server/mpm_unix.c Mon Jun  6 21:26:56 2011
@@ -39,6 +39,7 @@
 
 #include "httpd.h"
 #include "http_config.h"
+#include "http_core.h"
 #include "http_log.h"
 #include "http_main.h"
 #include "mpm_common.h"
@@ -58,7 +59,9 @@
 #endif
 
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 typedef enum {DO_NOTHING, SEND_SIGTERM, SEND_SIGKILL, GIVEUP} action_t;
 

Modified: httpd/httpd/trunk/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/protocol.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/protocol.c (original)
+++ httpd/httpd/trunk/server/protocol.c Mon Jun  6 21:26:56 2011
@@ -56,8 +56,9 @@
 #include <unistd.h>
 #endif
 
-
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 APR_HOOK_STRUCT(
     APR_HOOK_LINK(pre_read_request)
@@ -107,8 +108,7 @@ AP_DECLARE(const char *)ap_make_content_
 {
     const apr_strmatch_pattern **pcset;
     core_dir_config *conf =
-        (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                                &core_module);
+        (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
     core_request_config *request_conf;
     apr_size_t type_len;
 
@@ -120,8 +120,7 @@ AP_DECLARE(const char *)ap_make_content_
         return type;
     }
 
-    request_conf =
-        ap_get_module_config(r->request_config, &core_module);
+    request_conf = ap_get_core_module_config(r->request_config);
     if (request_conf->suppress_charset) {
         return type;
     }
@@ -954,7 +953,7 @@ request_rec *ap_read_request(conn_rec *c
      * to the normal timeout mode as we fetch the header lines,
      * as necessary.
      */
-    csd = ap_get_module_config(conn->conn_config, &core_module);
+    csd = ap_get_core_module_config(conn->conn_config);
     apr_socket_timeout_get(csd, &cur_timeout);
     if (cur_timeout != conn->base_server->timeout) {
         apr_socket_timeout_set(csd, conn->base_server->timeout);

Modified: httpd/httpd/trunk/server/request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/request.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/request.c (original)
+++ httpd/httpd/trunk/server/request.c Mon Jun  6 21:26:56 2011
@@ -54,7 +54,9 @@
 #include <stdarg.h>
 #endif
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 APR_HOOK_STRUCT(
     APR_HOOK_LINK(translate_name)
@@ -122,7 +124,7 @@ AP_DECLARE(int) ap_process_request_inter
 
     /* Ignore embedded %2F's in path for proxy requests */
     if (!r->proxyreq && r->parsed_uri.path) {
-        d = ap_get_module_config(r->per_dir_config, &core_module);
+        d = ap_get_core_module_config(r->per_dir_config);
         if (d->allow_encoded_slashes) {
             access_status = ap_unescape_url_keep2f(r->parsed_uri.path, d->decode_encoded_slashes);
         }
@@ -156,7 +158,7 @@ AP_DECLARE(int) ap_process_request_inter
             return access_status;
         }
 
-        d = ap_get_module_config(r->per_dir_config, &core_module);
+        d = ap_get_core_module_config(r->per_dir_config);
         if (d->log) {
             r->log = d->log;
         }
@@ -184,7 +186,7 @@ AP_DECLARE(int) ap_process_request_inter
         return access_status;
     }
 
-    d = ap_get_module_config(r->per_dir_config, &core_module);
+    d = ap_get_core_module_config(r->per_dir_config);
     if (d->log) {
         r->log = d->log;
     }
@@ -488,7 +490,7 @@ typedef struct core_opts_t {
 
 static void core_opts_merge(const ap_conf_vector_t *sec, core_opts_t *opts)
 {
-    core_dir_config *this_dir = ap_get_module_config(sec, &core_module);
+    core_dir_config *this_dir = ap_get_core_module_config(sec);
 
     if (!this_dir) {
         return;
@@ -532,8 +534,8 @@ static void core_opts_merge(const ap_con
 AP_DECLARE(int) ap_directory_walk(request_rec *r)
 {
     ap_conf_vector_t *now_merged = NULL;
-    core_server_config *sconf = ap_get_module_config(r->server->module_config,
-                                                     &core_module);
+    core_server_config *sconf =
+        ap_get_core_module_config(r->server->module_config);
     ap_conf_vector_t **sec_ent = (ap_conf_vector_t **) sconf->sec_dir->elts;
     int num_sec = sconf->sec_dir->nelts;
     walk_cache_t *cache;
@@ -649,7 +651,7 @@ AP_DECLARE(int) ap_directory_walk(reques
             allow_options_t opts;
             core_dir_config *this_dir;
 
-            this_dir = ap_get_module_config(r->per_dir_config, &core_module);
+            this_dir = ap_get_core_module_config(r->per_dir_config);
             opts = this_dir->opts;
             /*
              * If Symlinks are allowed in general we do not need the following
@@ -732,7 +734,7 @@ AP_DECLARE(int) ap_directory_walk(reques
          * We didn't start the merge from r->per_dir_config, so we
          * accumulate opts and override as we merge, from the globals.
          */
-        this_dir = ap_get_module_config(r->per_dir_config, &core_module);
+        this_dir = ap_get_core_module_config(r->per_dir_config);
         opts.opts = this_dir->opts;
         opts.add = this_dir->opts_add;
         opts.remove = this_dir->opts_remove;
@@ -873,7 +875,7 @@ AP_DECLARE(int) ap_directory_walk(reques
 
                 ap_conf_vector_t *entry_config = sec_ent[sec_idx];
                 core_dir_config *entry_core;
-                entry_core = ap_get_module_config(entry_config, &core_module);
+                entry_core = ap_get_core_module_config(entry_config);
 
                 /* No more possible matches for this many segments?
                  * We are done when we find relative/regex/longer components.
@@ -1169,7 +1171,7 @@ AP_DECLARE(int) ap_directory_walk(reques
         for (; sec_idx < num_sec; ++sec_idx) {
 
             core_dir_config *entry_core;
-            entry_core = ap_get_module_config(sec_ent[sec_idx], &core_module);
+            entry_core = ap_get_core_module_config(sec_ent[sec_idx]);
 
             if (!entry_core->r) {
                 continue;
@@ -1292,8 +1294,8 @@ AP_DECLARE(int) ap_directory_walk(reques
 AP_DECLARE(int) ap_location_walk(request_rec *r)
 {
     ap_conf_vector_t *now_merged = NULL;
-    core_server_config *sconf = ap_get_module_config(r->server->module_config,
-                                                     &core_module);
+    core_server_config *sconf =
+        ap_get_core_module_config(r->server->module_config);
     ap_conf_vector_t **sec_ent = (ap_conf_vector_t **)sconf->sec_url->elts;
     int num_sec = sconf->sec_url->nelts;
     walk_cache_t *cache;
@@ -1365,7 +1367,7 @@ AP_DECLARE(int) ap_location_walk(request
         for (sec_idx = 0; sec_idx < num_sec; ++sec_idx) {
 
             core_dir_config *entry_core;
-            entry_core = ap_get_module_config(sec_ent[sec_idx], &core_module);
+            entry_core = ap_get_core_module_config(sec_ent[sec_idx]);
 
             /* ### const strlen can be optimized in location config parsing */
             len = strlen(entry_core->d);
@@ -1457,8 +1459,7 @@ AP_DECLARE(int) ap_location_walk(request
 AP_DECLARE(int) ap_file_walk(request_rec *r)
 {
     ap_conf_vector_t *now_merged = NULL;
-    core_dir_config *dconf = ap_get_module_config(r->per_dir_config,
-                                                  &core_module);
+    core_dir_config *dconf = ap_get_core_module_config(r->per_dir_config);
     ap_conf_vector_t **sec_ent = NULL;
     int num_sec = 0;
     walk_cache_t *cache;
@@ -1539,7 +1540,7 @@ AP_DECLARE(int) ap_file_walk(request_rec
          */
         for (sec_idx = 0; sec_idx < num_sec; ++sec_idx) {
             core_dir_config *entry_core;
-            entry_core = ap_get_module_config(sec_ent[sec_idx], &core_module);
+            entry_core = ap_get_core_module_config(sec_ent[sec_idx]);
 
             if (entry_core->r
                 ? ap_regexec(entry_core->r, cache->cached , 0, NULL, 0)
@@ -1619,8 +1620,7 @@ AP_DECLARE(int) ap_file_walk(request_rec
 AP_DECLARE(int) ap_if_walk(request_rec *r)
 {
     ap_conf_vector_t *now_merged = NULL;
-    core_dir_config *dconf = ap_get_module_config(r->per_dir_config,
-                                                  &core_module);
+    core_dir_config *dconf = ap_get_core_module_config(r->per_dir_config);
     ap_conf_vector_t **sec_ent = NULL;
     int num_sec = 0;
     walk_cache_t *cache;
@@ -1658,7 +1658,7 @@ AP_DECLARE(int) ap_if_walk(request_rec *
         const char *err = NULL;
         core_dir_config *entry_core;
         int rc;
-        entry_core = ap_get_module_config(sec_ent[sec_idx], &core_module);
+        entry_core = ap_get_core_module_config(sec_ent[sec_idx]);
 
         AP_DEBUG_ASSERT(entry_core->condition_ifelse != 0);
         if (entry_core->condition_ifelse & AP_CONDITION_ELSE) {

Modified: httpd/httpd/trunk/server/scoreboard.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/scoreboard.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/scoreboard.c (original)
+++ httpd/httpd/trunk/server/scoreboard.c Mon Jun  6 21:26:56 2011
@@ -36,7 +36,9 @@
 
 #include "scoreboard.h"
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 AP_DECLARE_DATA scoreboard *ap_scoreboard_image = NULL;
 AP_DECLARE_DATA const char *ap_scoreboard_fname = NULL;

Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Mon Jun  6 21:26:56 2011
@@ -52,6 +52,7 @@
 #include "http_log.h"
 #include "http_protocol.h"
 #include "http_config.h"
+#include "http_core.h"
 #include "util_ebcdic.h"
 
 #ifdef HAVE_PWD_H
@@ -85,7 +86,9 @@
 #define SLASHES "/"
 #endif
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 
 /*

Modified: httpd/httpd/trunk/server/util_cookies.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_cookies.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_cookies.c (original)
+++ httpd/httpd/trunk/server/util_cookies.c Mon Jun  6 21:26:56 2011
@@ -18,11 +18,14 @@
 #include "apr_lib.h"
 #include "apr_strings.h"
 #include "http_config.h"
+#include "http_core.h"
 #include "http_log.h"
 
 #define LOG_PREFIX "ap_cookie: "
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 /**
  * Write an RFC2109 compliant cookie.

Modified: httpd/httpd/trunk/server/util_debug.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_debug.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_debug.c (original)
+++ httpd/httpd/trunk/server/util_debug.c Mon Jun  6 21:26:56 2011
@@ -19,6 +19,7 @@
 
 #include "httpd.h"
 #include "http_config.h"
+#include "http_core.h"
 
 /* Possibly get rid of the macros we defined in httpd.h */
 #if defined(strchr)
@@ -106,6 +107,17 @@ AP_DECLARE(void *) ap_get_module_config(
     return ((void **)cv)[m->module_index];
 }
 
+#if defined(ap_get_core_module_config)
+#undef ap_get_core_module_config
+AP_DECLARE(void *) ap_get_core_module_config(const ap_conf_vector_t *cv);
+#endif
+
+AP_DECLARE(void *) ap_get_core_module_config(const ap_conf_vector_t *cv)
+{
+    return ((void **)cv)[AP_CORE_MODULE_INDEX];
+}
+
+
 #if defined(ap_get_server_module_loglevel)
 #undef ap_get_server_module_loglevel
 AP_DECLARE(int) ap_get_server_module_loglevel(const server_rec *s, int module_index);
@@ -200,3 +212,14 @@ AP_DECLARE(void) ap_set_module_config(ap
 {
     ((void **)cv)[m->module_index] = val;
 }
+
+
+#if defined(ap_set_core_module_config)
+#undef ap_set_core_module_config
+AP_DECLARE(void) ap_set_core_module_config(ap_conf_vector_t *cv, void *val);
+#endif
+
+AP_DECLARE(void) ap_set_core_module_config(ap_conf_vector_t *cv, void *val)
+{
+    ((void **)cv)[AP_CORE_MODULE_INDEX] = val;
+}

Modified: httpd/httpd/trunk/server/util_ebcdic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_ebcdic.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_ebcdic.c (original)
+++ httpd/httpd/trunk/server/util_ebcdic.c Mon Jun  6 21:26:56 2011
@@ -24,7 +24,9 @@
 #include "http_core.h"
 #include "util_ebcdic.h"
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 apr_status_t ap_init_ebcdic(apr_pool_t *pool)
 {

Modified: httpd/httpd/trunk/server/util_expr_eval.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr_eval.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_expr_eval.c (original)
+++ httpd/httpd/trunk/server/util_expr_eval.c Mon Jun  6 21:26:56 2011
@@ -29,7 +29,9 @@
 #include "apr_lib.h"
 #include "apr_fnmatch.h"
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 APR_HOOK_STRUCT(
     APR_HOOK_LINK(expr_lookup)

Modified: httpd/httpd/trunk/server/util_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_filter.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_filter.c (original)
+++ httpd/httpd/trunk/server/util_filter.c Mon Jun  6 21:26:56 2011
@@ -22,6 +22,7 @@
 
 #include "httpd.h"
 #include "http_config.h"
+#include "http_core.h"
 #include "http_log.h"
 #include "util_filter.h"
 
@@ -45,7 +46,9 @@
  * filter names to filters
  */
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 typedef struct filter_trie_node filter_trie_node;
 

Modified: httpd/httpd/trunk/server/util_mutex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_mutex.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_mutex.c (original)
+++ httpd/httpd/trunk/server/util_mutex.c Mon Jun  6 21:26:56 2011
@@ -32,6 +32,7 @@
 #include "httpd.h"
 #include "http_main.h"
 #include "http_config.h"
+#include "http_core.h"
 #include "http_log.h"
 #include "util_mutex.h"
 #if AP_NEED_SET_MUTEX_PERMS
@@ -41,7 +42,9 @@
 #include <unistd.h> /* getpid() */
 #endif
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 AP_DECLARE(apr_status_t) ap_parse_mutex(const char *arg, apr_pool_t *pool,
                                         apr_lockmech_e *mutexmech,

Modified: httpd/httpd/trunk/server/util_script.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_script.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_script.c (original)
+++ httpd/httpd/trunk/server/util_script.c Mon Jun  6 21:26:56 2011
@@ -52,7 +52,9 @@
 #define MALFORMED_MESSAGE "malformed header from script. Bad header="
 #define MALFORMED_HEADER_LENGTH_TO_SHOW 30
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 static char *http2env(request_rec *r, const char *w)
 {

Modified: httpd/httpd/trunk/server/util_xml.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_xml.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_xml.c (original)
+++ httpd/httpd/trunk/server/util_xml.c Mon Jun  6 21:26:56 2011
@@ -29,7 +29,9 @@
 #define READ_BLOCKSIZE 2048
 
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc)
 {

Modified: httpd/httpd/trunk/server/vhost.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/vhost.c?rev=1132781&r1=1132780&r2=1132781&view=diff
==============================================================================
--- httpd/httpd/trunk/server/vhost.c (original)
+++ httpd/httpd/trunk/server/vhost.c Mon Jun  6 21:26:56 2011
@@ -39,7 +39,9 @@
 #include <arpa/inet.h>
 #endif
 
-APLOG_USE_MODULE(core);
+/* we know core's module_index is 0 */
+#undef APLOG_MODULE_INDEX
+#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
 
 /*
  * After all the definitions there's an explanation of how it's all put



Mime
View raw message