summaryrefslogtreecommitdiff
path: root/modules/generators
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2011-06-06 21:26:56 +0000
committerStefan Fritsch <sf@apache.org>2011-06-06 21:26:56 +0000
commitc9fd2623da21dc757571e93f8c14344946e59ec7 (patch)
tree97105b5ef35c293af0ec20d6e04492bf889a9098 /modules/generators
parent8b98cff9529e5842e292caf5417e425f18d31038 (diff)
downloadhttpd-c9fd2623da21dc757571e93f8c14344946e59ec7.tar.gz
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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/generators')
-rw-r--r--modules/generators/mod_cgi.c3
-rw-r--r--modules/generators/mod_cgid.c7
2 files changed, 3 insertions, 7 deletions
diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c
index 52a038327b..29eca51f26 100644
--- a/modules/generators/mod_cgi.c
+++ b/modules/generators/mod_cgi.c
@@ -385,8 +385,7 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
#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
diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c
index 0df7f6d13d..148ff534d4 100644
--- a/modules/generators/mod_cgid.c
+++ b/modules/generators/mod_cgid.c
@@ -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, request_rec *r, char **argv0, char ***env,
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, request_rec *r, char *argv0, char **env,
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, request_rec *r, char *argv0, char **env,
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;
}