mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
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
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
BEGIN {
|
BEGIN {
|
||||||
RS = " "
|
RS = " "
|
||||||
|
# the core module must come first
|
||||||
modules[n++] = "core"
|
modules[n++] = "core"
|
||||||
pmodules[pn++] = "core"
|
pmodules[pn++] = "core"
|
||||||
}
|
}
|
||||||
|
@@ -331,6 +331,7 @@
|
|||||||
* Add members of core_request_config: document_root,
|
* Add members of core_request_config: document_root,
|
||||||
* context_document_root, context_prefix.
|
* context_document_root, context_prefix.
|
||||||
* Add ap_context_*(), ap_set_context_info(), ap_set_document_root()
|
* 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" */
|
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
|
||||||
@@ -338,7 +339,7 @@
|
|||||||
#ifndef MODULE_MAGIC_NUMBER_MAJOR
|
#ifndef MODULE_MAGIC_NUMBER_MAJOR
|
||||||
#define MODULE_MAGIC_NUMBER_MAJOR 20110605
|
#define MODULE_MAGIC_NUMBER_MAJOR 20110605
|
||||||
#endif
|
#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
|
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
|
||||||
|
@@ -318,6 +318,34 @@ AP_DECLARE(int) ap_satisfies(request_rec *r);
|
|||||||
*/
|
*/
|
||||||
AP_DECLARE_DATA extern module core_module;
|
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
|
* @brief Per-request configuration
|
||||||
*/
|
*/
|
||||||
|
3
modules/cache/mod_cache_disk.c
vendored
3
modules/cache/mod_cache_disk.c
vendored
@@ -409,8 +409,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
|
|||||||
disk_cache_conf *conf = ap_get_module_config(r->server->module_config,
|
disk_cache_conf *conf = ap_get_module_config(r->server->module_config,
|
||||||
&cache_disk_module);
|
&cache_disk_module);
|
||||||
#ifdef APR_SENDFILE_ENABLED
|
#ifdef APR_SENDFILE_ENABLED
|
||||||
core_dir_config *coreconf = ap_get_module_config(r->per_dir_config,
|
core_dir_config *coreconf = ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
#endif
|
#endif
|
||||||
apr_finfo_t finfo;
|
apr_finfo_t finfo;
|
||||||
cache_object_t *obj;
|
cache_object_t *obj;
|
||||||
|
@@ -168,7 +168,7 @@ static int process_echo_connection(conn_rec *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!csd) {
|
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);
|
apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include "httpd.h"
|
#include "httpd.h"
|
||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
|
#include "http_core.h"
|
||||||
#include "http_connection.h"
|
#include "http_connection.h"
|
||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
#include "mpm_common.h"
|
#include "mpm_common.h"
|
||||||
@@ -43,7 +44,6 @@
|
|||||||
#include "scoreboard.h"
|
#include "scoreboard.h"
|
||||||
|
|
||||||
module AP_MODULE_DECLARE_DATA noloris_module;
|
module AP_MODULE_DECLARE_DATA noloris_module;
|
||||||
module AP_MODULE_DECLARE_DATA core_module;
|
|
||||||
|
|
||||||
#define ADDR_MAX_SIZE 48
|
#define ADDR_MAX_SIZE 48
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ static int noloris_conn(conn_rec *conn)
|
|||||||
shm_rec = apr_shm_baseaddr_get(shm);
|
shm_rec = apr_shm_baseaddr_get(shm);
|
||||||
while (shm_rec[0] != '\0') {
|
while (shm_rec[0] != '\0') {
|
||||||
if (!strcmp(shm_rec, conn->remote_ip)) {
|
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,
|
ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, conn,
|
||||||
"Dropping connection from banned IP %s",
|
"Dropping connection from banned IP %s",
|
||||||
conn->remote_ip);
|
conn->remote_ip);
|
||||||
|
@@ -365,8 +365,7 @@ static apr_status_t set_resource_limits(request_rec *r,
|
|||||||
#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || \
|
#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || \
|
||||||
defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
|
defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
|
||||||
core_dir_config *conf =
|
core_dir_config *conf =
|
||||||
(core_dir_config *)ap_get_module_config(r->per_dir_config,
|
(core_dir_config *)ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
apr_status_t rv;
|
apr_status_t rv;
|
||||||
|
|
||||||
#ifdef RLIMIT_CPU
|
#ifdef RLIMIT_CPU
|
||||||
|
@@ -186,7 +186,7 @@ static apr_status_t reqtimeout_filter(ap_filter_t *f,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ccfg->socket) {
|
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);
|
rv = check_time_left(ccfg, &time_left);
|
||||||
|
@@ -385,8 +385,7 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
|
|||||||
#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || \
|
#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || \
|
||||||
defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
|
defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
|
||||||
|
|
||||||
core_dir_config *conf = ap_get_module_config(r->per_dir_config,
|
core_dir_config *conf = ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_CGI
|
#ifdef DEBUG_CGI
|
||||||
|
@@ -195,7 +195,6 @@ typedef struct {
|
|||||||
pid_t ppid; /* sanity check for config problems leading to
|
pid_t ppid; /* sanity check for config problems leading to
|
||||||
* wrong cgid socket use
|
* wrong cgid socket use
|
||||||
*/
|
*/
|
||||||
int core_module_index;
|
|
||||||
int env_count;
|
int env_count;
|
||||||
ap_unix_identity_t ugid;
|
ap_unix_identity_t ugid;
|
||||||
apr_size_t filename_len;
|
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);
|
rconf = (void **)ap_create_request_config(r->pool);
|
||||||
|
|
||||||
temp_core = (core_request_config *)apr_palloc(r->pool, sizeof(core_module));
|
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;
|
r->request_config = (ap_conf_vector_t *)rconf;
|
||||||
ap_set_module_config(r->request_config, &cgid_module, (void *)&req->ugid);
|
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};
|
cgid_req_t req = {0};
|
||||||
apr_status_t stat;
|
apr_status_t stat;
|
||||||
ap_unix_identity_t * ugid = ap_run_get_suexec_identity(r);
|
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_dir_config *core_conf = ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
|
|
||||||
|
|
||||||
if (ugid == NULL) {
|
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.req_type = req_type;
|
||||||
req.ppid = parent_pid;
|
req.ppid = parent_pid;
|
||||||
req.conn_id = r->connection->id;
|
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++) {
|
for (req.env_count = 0; env[req.env_count]; req.env_count++) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -208,7 +208,7 @@ static int ap_process_http_sync_connection(conn_rec *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!csd) {
|
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_opt_set(csd, APR_INCOMPLETE_READ, 1);
|
||||||
apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
|
apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
|
||||||
|
@@ -70,8 +70,7 @@ AP_DECLARE(char *) ap_make_etag(request_rec *r, int force_weak)
|
|||||||
etag_components_t etag_bits;
|
etag_components_t etag_bits;
|
||||||
etag_components_t bits_added;
|
etag_components_t bits_added;
|
||||||
|
|
||||||
cfg = (core_dir_config *)ap_get_module_config(r->per_dir_config,
|
cfg = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
etag_bits = (cfg->etag_bits & (~ cfg->etag_remove)) | cfg->etag_add;
|
etag_bits = (cfg->etag_bits & (~ cfg->etag_remove)) | cfg->etag_add;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1033,8 +1033,7 @@ AP_DECLARE_NONSTD(int) ap_send_http_trace(request_rec *r)
|
|||||||
while (r->prev) {
|
while (r->prev) {
|
||||||
r = r->prev;
|
r = r->prev;
|
||||||
}
|
}
|
||||||
conf = (core_server_config *)ap_get_module_config(r->server->module_config,
|
conf = ap_get_core_module_config(r->server->module_config);
|
||||||
&core_module);
|
|
||||||
|
|
||||||
if (conf->trace_enable == AP_TRACE_DISABLE) {
|
if (conf->trace_enable == AP_TRACE_DISABLE) {
|
||||||
apr_table_setn(r->notes, "error-notes",
|
apr_table_setn(r->notes, "error-notes",
|
||||||
@@ -1520,8 +1519,7 @@ AP_DECLARE(int) ap_setup_client_block(request_rec *r, int read_policy)
|
|||||||
{
|
{
|
||||||
/* Make sure ap_getline() didn't leave any droppings. */
|
/* Make sure ap_getline() didn't leave any droppings. */
|
||||||
core_request_config *req_cfg =
|
core_request_config *req_cfg =
|
||||||
(core_request_config *)ap_get_module_config(r->request_config,
|
(core_request_config *)ap_get_core_module_config(r->request_config);
|
||||||
&core_module);
|
|
||||||
AP_DEBUG_ASSERT(APR_BRIGADE_EMPTY(req_cfg->bb));
|
AP_DEBUG_ASSERT(APR_BRIGADE_EMPTY(req_cfg->bb));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -781,7 +781,7 @@ static char *make_allow(request_rec *r)
|
|||||||
apr_hash_index_t *hi = apr_hash_first(r->pool, methods_registry);
|
apr_hash_index_t *hi = apr_hash_first(r->pool, methods_registry);
|
||||||
/* For TRACE below */
|
/* For TRACE below */
|
||||||
core_server_config *conf =
|
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;
|
mask = r->allowed_methods->method_mask;
|
||||||
|
|
||||||
@@ -1186,7 +1186,7 @@ AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error)
|
|||||||
if (apr_table_get(r->subprocess_env,
|
if (apr_table_get(r->subprocess_env,
|
||||||
"suppress-error-charset") != NULL) {
|
"suppress-error-charset") != NULL) {
|
||||||
core_request_config *request_conf =
|
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
|
request_conf->suppress_charset = 1; /* avoid adding default
|
||||||
* charset later
|
* charset later
|
||||||
*/
|
*/
|
||||||
|
@@ -886,7 +886,7 @@ static int proxy_handler(request_rec *r)
|
|||||||
|
|
||||||
if (r->method_number == M_TRACE) {
|
if (r->method_number == M_TRACE) {
|
||||||
core_server_config *coreconf = (core_server_config *)
|
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)
|
if (coreconf->trace_enable == AP_TRACE_DISABLE)
|
||||||
{
|
{
|
||||||
|
@@ -209,7 +209,7 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
apr_status_t err, rv;
|
apr_status_t err, rv;
|
||||||
apr_size_t nbytes;
|
apr_size_t nbytes;
|
||||||
char buffer[HUGE_STRING_LEN];
|
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 failed, rc;
|
||||||
int client_error = 0;
|
int client_error = 0;
|
||||||
apr_pollset_t *pollset;
|
apr_pollset_t *pollset;
|
||||||
|
@@ -223,7 +223,7 @@ static int proxy_fdpass_handler(request_rec *r, proxy_worker *worker,
|
|||||||
|
|
||||||
/* XXXXX: THIS IS AN EVIL HACK */
|
/* XXXXX: THIS IS AN EVIL HACK */
|
||||||
/* There should really be a (documented) public API for this ! */
|
/* 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);
|
rv = send_socket(r->pool, sock, clientsock);
|
||||||
if (rv != APR_SUCCESS) {
|
if (rv != APR_SUCCESS) {
|
||||||
@@ -245,7 +245,7 @@ static int proxy_fdpass_handler(request_rec *r, proxy_worker *worker,
|
|||||||
"proxy: FD: failed to create dummy socket");
|
"proxy: FD: failed to create dummy socket");
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -155,8 +155,7 @@ dialup_handler(request_rec *r)
|
|||||||
return DECLINED;
|
return DECLINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
ccfg = ap_get_module_config(r->per_dir_config,
|
ccfg = ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
|
|
||||||
|
|
||||||
rv = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY
|
rv = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY
|
||||||
|
@@ -45,7 +45,7 @@ extern module nwssl_module;
|
|||||||
extern module netware_module;
|
extern module netware_module;
|
||||||
|
|
||||||
module *ap_prelinked_modules[] = {
|
module *ap_prelinked_modules[] = {
|
||||||
&core_module,
|
&core_module, /* core must come first */
|
||||||
&mpm_netware_module,
|
&mpm_netware_module,
|
||||||
&http_module,
|
&http_module,
|
||||||
&so_module,
|
&so_module,
|
||||||
|
@@ -29,7 +29,7 @@ extern module http_module;
|
|||||||
extern module so_module;
|
extern module so_module;
|
||||||
|
|
||||||
AP_DECLARE_DATA module *ap_prelinked_modules[] = {
|
AP_DECLARE_DATA module *ap_prelinked_modules[] = {
|
||||||
&core_module,
|
&core_module, /* core must come first */
|
||||||
&win32_module,
|
&win32_module,
|
||||||
&mpm_winnt_module,
|
&mpm_winnt_module,
|
||||||
&http_module,
|
&http_module,
|
||||||
|
@@ -52,7 +52,9 @@
|
|||||||
#include "mpm_common.h"
|
#include "mpm_common.h"
|
||||||
|
|
||||||
#define APLOG_UNSET (APLOG_NO_MODULE - 1)
|
#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_argv0 = NULL;
|
||||||
AP_DECLARE_DATA const char *ap_server_root = NULL;
|
AP_DECLARE_DATA const char *ap_server_root = NULL;
|
||||||
@@ -2178,8 +2180,8 @@ AP_DECLARE(void) ap_merge_log_config(const struct ap_logconf *old_conf,
|
|||||||
AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server)
|
AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server)
|
||||||
{
|
{
|
||||||
server_rec *virt;
|
server_rec *virt;
|
||||||
core_dir_config *dconf = ap_get_module_config(main_server->lookup_defaults,
|
core_dir_config *dconf =
|
||||||
&core_module);
|
ap_get_core_module_config(main_server->lookup_defaults);
|
||||||
dconf->log = &main_server->log;
|
dconf->log = &main_server->log;
|
||||||
|
|
||||||
for (virt = main_server->next; virt; virt = virt->next) {
|
for (virt = main_server->next; virt; virt = virt->next) {
|
||||||
@@ -2207,7 +2209,7 @@ AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server)
|
|||||||
|
|
||||||
ap_merge_log_config(&main_server->log, &virt->log);
|
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;
|
dconf->log = &virt->log;
|
||||||
|
|
||||||
/* XXX: this is really something that should be dealt with by a
|
/* XXX: this is really something that should be dealt with by a
|
||||||
|
@@ -98,7 +98,7 @@ AP_DECLARE(void) ap_lingering_close(conn_rec *c)
|
|||||||
char dummybuf[512];
|
char dummybuf[512];
|
||||||
apr_size_t nbytes;
|
apr_size_t nbytes;
|
||||||
apr_time_t timeup = 0;
|
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) {
|
if (!csd) {
|
||||||
return;
|
return;
|
||||||
|
122
server/core.c
122
server/core.c
@@ -98,6 +98,10 @@ AP_IMPLEMENT_HOOK_RUN_ALL(int, get_mgmt_items,
|
|||||||
* the http_conf_globals.
|
* 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 */
|
/* Handles for core filters */
|
||||||
AP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle;
|
AP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle;
|
||||||
AP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle;
|
AP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle;
|
||||||
@@ -507,8 +511,7 @@ static void *merge_core_server_configs(apr_pool_t *p, void *basev, void *virtv)
|
|||||||
|
|
||||||
AP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config)
|
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_server_config *sconf = ap_get_core_module_config(s->module_config);
|
||||||
&core_module);
|
|
||||||
void **new_space = (void **)apr_array_push(sconf->sec_dir);
|
void **new_space = (void **)apr_array_push(sconf->sec_dir);
|
||||||
|
|
||||||
*new_space = dir_config;
|
*new_space = dir_config;
|
||||||
@@ -516,8 +519,7 @@ AP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config)
|
|||||||
|
|
||||||
AP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config)
|
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_server_config *sconf = ap_get_core_module_config(s->module_config);
|
||||||
&core_module);
|
|
||||||
void **new_space = (void **)apr_array_push(sconf->sec_url);
|
void **new_space = (void **)apr_array_push(sconf->sec_url);
|
||||||
|
|
||||||
*new_space = url_config;
|
*new_space = url_config;
|
||||||
@@ -584,8 +586,8 @@ static int reorder_sorter(const void *va, const void *vb)
|
|||||||
core_dir_config *core_a;
|
core_dir_config *core_a;
|
||||||
core_dir_config *core_b;
|
core_dir_config *core_b;
|
||||||
|
|
||||||
core_a = ap_get_module_config(a->elt, &core_module);
|
core_a = ap_get_core_module_config(a->elt);
|
||||||
core_b = ap_get_module_config(b->elt, &core_module);
|
core_b = ap_get_core_module_config(b->elt);
|
||||||
|
|
||||||
/* a regex always sorts after a non-regex
|
/* a regex always sorts after a non-regex
|
||||||
*/
|
*/
|
||||||
@@ -621,7 +623,7 @@ void ap_core_reorder_directories(apr_pool_t *p, server_rec *s)
|
|||||||
int i;
|
int i;
|
||||||
apr_pool_t *tmp;
|
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;
|
sec_dir = sconf->sec_dir;
|
||||||
nelts = sec_dir->nelts;
|
nelts = sec_dir->nelts;
|
||||||
elts = (ap_conf_vector_t **)sec_dir->elts;
|
elts = (ap_conf_vector_t **)sec_dir->elts;
|
||||||
@@ -664,7 +666,7 @@ void ap_core_reorder_directories(apr_pool_t *p, server_rec *s)
|
|||||||
AP_DECLARE(int) ap_allow_options(request_rec *r)
|
AP_DECLARE(int) ap_allow_options(request_rec *r)
|
||||||
{
|
{
|
||||||
core_dir_config *conf =
|
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;
|
return conf->opts;
|
||||||
}
|
}
|
||||||
@@ -672,8 +674,7 @@ AP_DECLARE(int) ap_allow_options(request_rec *r)
|
|||||||
AP_DECLARE(int) ap_allow_overrides(request_rec *r)
|
AP_DECLARE(int) ap_allow_overrides(request_rec *r)
|
||||||
{
|
{
|
||||||
core_dir_config *conf;
|
core_dir_config *conf;
|
||||||
conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
|
conf = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
|
|
||||||
return conf->override;
|
return conf->override;
|
||||||
}
|
}
|
||||||
@@ -723,18 +724,16 @@ AP_DECLARE(int) ap_satisfies(request_rec *r)
|
|||||||
AP_DECLARE(const char *) ap_document_root(request_rec *r) /* Don't use this! */
|
AP_DECLARE(const char *) ap_document_root(request_rec *r) /* Don't use this! */
|
||||||
{
|
{
|
||||||
core_server_config *sconf;
|
core_server_config *sconf;
|
||||||
core_request_config *rconf = ap_get_module_config(r->request_config,
|
core_request_config *rconf = ap_get_core_module_config(r->request_config);
|
||||||
&core_module);
|
|
||||||
if (rconf->document_root)
|
if (rconf->document_root)
|
||||||
return 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;
|
return sconf->ap_document_root;
|
||||||
}
|
}
|
||||||
|
|
||||||
AP_DECLARE(const char *) ap_context_prefix(request_rec *r)
|
AP_DECLARE(const char *) ap_context_prefix(request_rec *r)
|
||||||
{
|
{
|
||||||
core_request_config *conf = ap_get_module_config(r->request_config,
|
core_request_config *conf = ap_get_core_module_config(r->request_config);
|
||||||
&core_module);
|
|
||||||
if (conf->context_prefix)
|
if (conf->context_prefix)
|
||||||
return conf->context_prefix;
|
return conf->context_prefix;
|
||||||
else
|
else
|
||||||
@@ -743,8 +742,7 @@ AP_DECLARE(const char *) ap_context_prefix(request_rec *r)
|
|||||||
|
|
||||||
AP_DECLARE(const char *) ap_context_document_root(request_rec *r)
|
AP_DECLARE(const char *) ap_context_document_root(request_rec *r)
|
||||||
{
|
{
|
||||||
core_request_config *conf = ap_get_module_config(r->request_config,
|
core_request_config *conf = ap_get_core_module_config(r->request_config);
|
||||||
&core_module);
|
|
||||||
if (conf->context_document_root)
|
if (conf->context_document_root)
|
||||||
return conf->context_document_root;
|
return conf->context_document_root;
|
||||||
else
|
else
|
||||||
@@ -753,16 +751,14 @@ AP_DECLARE(const char *) ap_context_document_root(request_rec *r)
|
|||||||
|
|
||||||
AP_DECLARE(void) ap_set_document_root(request_rec *r, const char *document_root)
|
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_request_config *conf = ap_get_core_module_config(r->request_config);
|
||||||
&core_module);
|
|
||||||
conf->document_root = document_root;
|
conf->document_root = document_root;
|
||||||
}
|
}
|
||||||
|
|
||||||
AP_DECLARE(void) ap_set_context_info(request_rec *r, const char *context_prefix,
|
AP_DECLARE(void) ap_set_context_info(request_rec *r, const char *context_prefix,
|
||||||
const char *context_document_root)
|
const char *context_document_root)
|
||||||
{
|
{
|
||||||
core_request_config *conf = ap_get_module_config(r->request_config,
|
core_request_config *conf = ap_get_core_module_config(r->request_config);
|
||||||
&core_module);
|
|
||||||
if (context_prefix)
|
if (context_prefix)
|
||||||
conf->context_prefix = context_prefix;
|
conf->context_prefix = context_prefix;
|
||||||
if (context_document_root)
|
if (context_document_root)
|
||||||
@@ -777,19 +773,16 @@ AP_DECLARE(void) ap_set_context_info(request_rec *r, const char *context_prefix,
|
|||||||
char *ap_response_code_string(request_rec *r, int error_index)
|
char *ap_response_code_string(request_rec *r, int error_index)
|
||||||
{
|
{
|
||||||
core_dir_config *dirconf;
|
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 */
|
/* 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 &&
|
if (reqconf->response_code_strings != NULL &&
|
||||||
reqconf->response_code_strings[error_index] != NULL) {
|
reqconf->response_code_strings[error_index] != NULL) {
|
||||||
return reqconf->response_code_strings[error_index];
|
return reqconf->response_code_strings[error_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for string specified via ErrorDocument */
|
/* check for string specified via ErrorDocument */
|
||||||
dirconf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
|
dirconf = ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
|
|
||||||
if (dirconf->response_code_strings == NULL) {
|
if (dirconf->response_code_strings == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -848,9 +841,8 @@ AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
|
|||||||
|
|
||||||
/* If we haven't checked the host name, and we want to */
|
/* If we haven't checked the host name, and we want to */
|
||||||
if (dir_config) {
|
if (dir_config) {
|
||||||
hostname_lookups =
|
hostname_lookups = ((core_dir_config *)ap_get_core_module_config(dir_config))
|
||||||
((core_dir_config *)ap_get_module_config(dir_config, &core_module))
|
->hostname_lookups;
|
||||||
->hostname_lookups;
|
|
||||||
|
|
||||||
if (hostname_lookups == HOSTNAME_LOOKUP_UNSET) {
|
if (hostname_lookups == HOSTNAME_LOOKUP_UNSET) {
|
||||||
hostname_lookups = HOSTNAME_LOOKUP_OFF;
|
hostname_lookups = HOSTNAME_LOOKUP_OFF;
|
||||||
@@ -945,8 +937,7 @@ AP_DECLARE(const char *) ap_get_server_name(request_rec *r)
|
|||||||
core_dir_config *d;
|
core_dir_config *d;
|
||||||
const char *retval;
|
const char *retval;
|
||||||
|
|
||||||
d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
|
d = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
|
|
||||||
switch (d->use_canonical_name) {
|
switch (d->use_canonical_name) {
|
||||||
case USE_CANONICAL_NAME_ON:
|
case USE_CANONICAL_NAME_ON:
|
||||||
@@ -998,7 +989,7 @@ AP_DECLARE(apr_port_t) ap_get_server_port(const request_rec *r)
|
|||||||
{
|
{
|
||||||
apr_port_t port;
|
apr_port_t port;
|
||||||
core_dir_config *d =
|
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) {
|
switch (d->use_canonical_name) {
|
||||||
case USE_CANONICAL_NAME_OFF:
|
case USE_CANONICAL_NAME_OFF:
|
||||||
@@ -1057,7 +1048,7 @@ AP_DECLARE(char *) ap_construct_url(apr_pool_t *p, const char *uri,
|
|||||||
AP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r)
|
AP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r)
|
||||||
{
|
{
|
||||||
core_dir_config *d =
|
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) {
|
if (d->limit_req_body == AP_LIMIT_REQ_BODY_UNSET) {
|
||||||
return AP_DEFAULT_LIMIT_REQ_BODY;
|
return AP_DEFAULT_LIMIT_REQ_BODY;
|
||||||
@@ -1144,7 +1135,7 @@ static const char *set_access_name(cmd_parms *cmd, void *dummy,
|
|||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
void *sconf = cmd->server->module_config;
|
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);
|
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
@@ -1340,7 +1331,7 @@ static const char *generate_error(cmd_parms *cmd, void *dummy,
|
|||||||
static const char *set_gprof_dir(cmd_parms *cmd, void *dummy, const char *arg)
|
static const char *set_gprof_dir(cmd_parms *cmd, void *dummy, const char *arg)
|
||||||
{
|
{
|
||||||
void *sconf = cmd->server->module_config;
|
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);
|
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
@@ -1376,7 +1367,7 @@ static const char *set_document_root(cmd_parms *cmd, void *dummy,
|
|||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
void *sconf = cmd->server->module_config;
|
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);
|
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
@@ -1416,8 +1407,7 @@ static const char *set_document_root(cmd_parms *cmd, void *dummy,
|
|||||||
AP_DECLARE(void) ap_custom_response(request_rec *r, int status,
|
AP_DECLARE(void) ap_custom_response(request_rec *r, int status,
|
||||||
const char *string)
|
const char *string)
|
||||||
{
|
{
|
||||||
core_request_config *conf =
|
core_request_config *conf = ap_get_core_module_config(r->request_config);
|
||||||
ap_get_module_config(r->request_config, &core_module);
|
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
if (conf->response_code_strings == NULL) {
|
if (conf->response_code_strings == NULL) {
|
||||||
@@ -2545,8 +2535,8 @@ static const char *set_accf_map(cmd_parms *cmd, void *dummy,
|
|||||||
const char *iproto, const char* iaccf)
|
const char *iproto, const char* iaccf)
|
||||||
{
|
{
|
||||||
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
|
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
|
||||||
core_server_config *conf = ap_get_module_config(cmd->server->module_config,
|
core_server_config *conf =
|
||||||
&core_module);
|
ap_get_core_module_config(cmd->server->module_config);
|
||||||
char* proto;
|
char* proto;
|
||||||
char* accf;
|
char* accf;
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
@@ -2564,15 +2554,13 @@ static const char *set_accf_map(cmd_parms *cmd, void *dummy,
|
|||||||
|
|
||||||
AP_DECLARE(const char*) ap_get_server_protocol(server_rec* s)
|
AP_DECLARE(const char*) ap_get_server_protocol(server_rec* s)
|
||||||
{
|
{
|
||||||
core_server_config *conf = ap_get_module_config(s->module_config,
|
core_server_config *conf = ap_get_core_module_config(s->module_config);
|
||||||
&core_module);
|
|
||||||
return conf->protocol;
|
return conf->protocol;
|
||||||
}
|
}
|
||||||
|
|
||||||
AP_DECLARE(void) ap_set_server_protocol(server_rec* s, const char* proto)
|
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_server_config *conf = ap_get_core_module_config(s->module_config);
|
||||||
&core_module);
|
|
||||||
conf->protocol = proto;
|
conf->protocol = proto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2580,8 +2568,8 @@ static const char *set_protocol(cmd_parms *cmd, void *dummy,
|
|||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
|
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_server_config *conf =
|
||||||
&core_module);
|
ap_get_core_module_config(cmd->server->module_config);
|
||||||
char* proto;
|
char* proto;
|
||||||
|
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
@@ -2970,8 +2958,7 @@ AP_DECLARE(const char *) ap_psignature(const char *prefix, request_rec *r)
|
|||||||
char sport[20];
|
char sport[20];
|
||||||
core_dir_config *conf;
|
core_dir_config *conf;
|
||||||
|
|
||||||
conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
|
conf = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
if ((conf->server_signature == srv_sig_off)
|
if ((conf->server_signature == srv_sig_off)
|
||||||
|| (conf->server_signature == srv_sig_unset)) {
|
|| (conf->server_signature == srv_sig_unset)) {
|
||||||
return "";
|
return "";
|
||||||
@@ -3231,7 +3218,7 @@ AP_DECLARE(size_t) ap_get_limit_xml_body(const request_rec *r)
|
|||||||
{
|
{
|
||||||
core_dir_config *conf;
|
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)
|
if (conf->limit_xml_body == AP_LIMIT_UNSET)
|
||||||
return AP_DEFAULT_LIMIT_XML_BODY;
|
return AP_DEFAULT_LIMIT_XML_BODY;
|
||||||
|
|
||||||
@@ -3292,8 +3279,8 @@ static const char *set_limit_nproc(cmd_parms *cmd, void *conf_,
|
|||||||
static const char *set_recursion_limit(cmd_parms *cmd, void *dummy,
|
static const char *set_recursion_limit(cmd_parms *cmd, void *dummy,
|
||||||
const char *arg1, const char *arg2)
|
const char *arg1, const char *arg2)
|
||||||
{
|
{
|
||||||
core_server_config *conf = ap_get_module_config(cmd->server->module_config,
|
core_server_config *conf =
|
||||||
&core_module);
|
ap_get_core_module_config(cmd->server->module_config);
|
||||||
int limit = atoi(arg1);
|
int limit = atoi(arg1);
|
||||||
|
|
||||||
if (limit <= 0) {
|
if (limit <= 0) {
|
||||||
@@ -3354,8 +3341,8 @@ static void log_backtrace(const request_rec *r)
|
|||||||
*/
|
*/
|
||||||
AP_DECLARE(int) ap_is_recursion_limit_exceeded(const request_rec *r)
|
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_server_config *conf =
|
||||||
&core_module);
|
ap_get_core_module_config(r->server->module_config);
|
||||||
const request_rec *top = r;
|
const request_rec *top = r;
|
||||||
int redirects = 0, subreqs = 0;
|
int redirects = 0, subreqs = 0;
|
||||||
int rlimit = conf->redirect_limit
|
int rlimit = conf->redirect_limit
|
||||||
@@ -3415,8 +3402,8 @@ AP_DECLARE(int) ap_is_recursion_limit_exceeded(const request_rec *r)
|
|||||||
static const char *set_trace_enable(cmd_parms *cmd, void *dummy,
|
static const char *set_trace_enable(cmd_parms *cmd, void *dummy,
|
||||||
const char *arg1)
|
const char *arg1)
|
||||||
{
|
{
|
||||||
core_server_config *conf = ap_get_module_config(cmd->server->module_config,
|
core_server_config *conf =
|
||||||
&core_module);
|
ap_get_core_module_config(cmd->server->module_config);
|
||||||
|
|
||||||
if (strcasecmp(arg1, "on") == 0) {
|
if (strcasecmp(arg1, "on") == 0) {
|
||||||
conf->trace_enable = AP_TRACE_ENABLE;
|
conf->trace_enable = AP_TRACE_ENABLE;
|
||||||
@@ -3636,8 +3623,8 @@ static const char *set_errorlog_format(cmd_parms *cmd, void *dummy,
|
|||||||
const char *arg1, const char *arg2)
|
const char *arg1, const char *arg2)
|
||||||
{
|
{
|
||||||
const char *err_string = NULL;
|
const char *err_string = NULL;
|
||||||
core_server_config *conf = ap_get_module_config(cmd->server->module_config,
|
core_server_config *conf =
|
||||||
&core_module);
|
ap_get_core_module_config(cmd->server->module_config);
|
||||||
|
|
||||||
if (!arg2) {
|
if (!arg2) {
|
||||||
conf->error_log_format = parse_errorlog_string(cmd->pool, arg1,
|
conf->error_log_format = parse_errorlog_string(cmd->pool, arg1,
|
||||||
@@ -3930,7 +3917,7 @@ AP_INIT_TAKE1("TraceEnable", set_trace_enable, NULL, RSRC_CONF,
|
|||||||
AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r)
|
AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r)
|
||||||
{
|
{
|
||||||
void *sconf = r->server->module_config;
|
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;
|
apr_status_t rv;
|
||||||
|
|
||||||
/* XXX this seems too specific, this should probably become
|
/* XXX this seems too specific, this should probably become
|
||||||
@@ -4021,8 +4008,7 @@ static int do_nothing(request_rec *r) { return OK; }
|
|||||||
static int core_override_type(request_rec *r)
|
static int core_override_type(request_rec *r)
|
||||||
{
|
{
|
||||||
core_dir_config *conf =
|
core_dir_config *conf =
|
||||||
(core_dir_config *)ap_get_module_config(r->per_dir_config,
|
(core_dir_config *)ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
|
|
||||||
/* Check for overrides with ForceType / SetHandler
|
/* Check for overrides with ForceType / SetHandler
|
||||||
*/
|
*/
|
||||||
@@ -4070,8 +4056,7 @@ static int default_handler(request_rec *r)
|
|||||||
*/
|
*/
|
||||||
int bld_content_md5;
|
int bld_content_md5;
|
||||||
|
|
||||||
d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
|
d = (core_dir_config *)ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
bld_content_md5 = (d->content_md5 == AP_CONTENT_MD5_ON)
|
bld_content_md5 = (d->content_md5 == AP_CONTENT_MD5_ON)
|
||||||
&& r->output_filters->frec->ftype != AP_FTYPE_RESOURCE;
|
&& r->output_filters->frec->ftype != AP_FTYPE_RESOURCE;
|
||||||
|
|
||||||
@@ -4123,7 +4108,7 @@ static int default_handler(request_rec *r)
|
|||||||
if (r->method_number != M_GET) {
|
if (r->method_number != M_GET) {
|
||||||
core_request_config *req_cfg;
|
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) {
|
if (!req_cfg->deliver_script) {
|
||||||
/* The flag hasn't been set for this request. Punt. */
|
/* The flag hasn't been set for this request. Punt. */
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||||
@@ -4267,8 +4252,7 @@ static int core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte
|
|||||||
static void core_insert_filter(request_rec *r)
|
static void core_insert_filter(request_rec *r)
|
||||||
{
|
{
|
||||||
core_dir_config *conf = (core_dir_config *)
|
core_dir_config *conf = (core_dir_config *)
|
||||||
ap_get_module_config(r->per_dir_config,
|
ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
const char *filter, *filters = conf->output_filters;
|
const char *filter, *filters = conf->output_filters;
|
||||||
|
|
||||||
if (filters) {
|
if (filters) {
|
||||||
@@ -4309,7 +4293,7 @@ AP_DECLARE(void **) ap_get_request_note(request_rec *r, apr_size_t note_num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
req_cfg = (core_request_config *)
|
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) {
|
if (!req_cfg) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -4334,14 +4318,14 @@ static int core_create_req(request_rec *r)
|
|||||||
|
|
||||||
if (r->main) {
|
if (r->main) {
|
||||||
core_request_config *main_req_cfg = (core_request_config *)
|
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;
|
req_cfg->bb = main_req_cfg->bb;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
req_cfg->bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
|
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;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -4442,7 +4426,7 @@ static int core_pre_connection(conn_rec *c, void *csd)
|
|||||||
net->out_ctx = NULL;
|
net->out_ctx = NULL;
|
||||||
net->client_socket = csd;
|
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_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);
|
ap_add_output_filter_handle(ap_core_output_filter_handle, net, NULL, net->c);
|
||||||
return DONE;
|
return DONE;
|
||||||
|
@@ -74,7 +74,9 @@ do { \
|
|||||||
} while (!APR_BRIGADE_EMPTY(b) && (e != APR_BRIGADE_SENTINEL(b))); \
|
} while (!APR_BRIGADE_EMPTY(b) && (e != APR_BRIGADE_SENTINEL(b))); \
|
||||||
} while (0)
|
} 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,
|
int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
|
||||||
ap_input_mode_t mode, apr_read_type_e block,
|
ap_input_mode_t mode, apr_read_type_e block,
|
||||||
|
@@ -28,7 +28,9 @@
|
|||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
#include "mpm_common.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;
|
AP_DECLARE_DATA ap_listen_rec *ap_listeners = NULL;
|
||||||
|
|
||||||
@@ -178,8 +180,7 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
|
|||||||
static const char* find_accf_name(server_rec *s, const char *proto)
|
static const char* find_accf_name(server_rec *s, const char *proto)
|
||||||
{
|
{
|
||||||
const char* accf;
|
const char* accf;
|
||||||
core_server_config *conf = ap_get_module_config(s->module_config,
|
core_server_config *conf = ap_get_core_module_config(s->module_config);
|
||||||
&core_module);
|
|
||||||
if (!proto) {
|
if (!proto) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -54,7 +54,9 @@
|
|||||||
#include "util_time.h"
|
#include "util_time.h"
|
||||||
#include "ap_mpm.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 {
|
typedef struct {
|
||||||
const char *t_name;
|
const char *t_name;
|
||||||
@@ -1133,7 +1135,7 @@ static void log_error_core(const char *file, int line, int module_index,
|
|||||||
|
|
||||||
/* the faked server_rec from mod_cgid does not have s->module_config */
|
/* the faked server_rec from mod_cgid does not have s->module_config */
|
||||||
if (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) {
|
if (c && !c->log_id) {
|
||||||
add_log_id(c, NULL);
|
add_log_id(c, NULL);
|
||||||
if (sconf->error_log_conn && sconf->error_log_conn->nelts > 0)
|
if (sconf->error_log_conn && sconf->error_log_conn->nelts > 0)
|
||||||
|
@@ -157,7 +157,7 @@ static int my_child_num;
|
|||||||
static void chdir_for_gprof(void)
|
static void chdir_for_gprof(void)
|
||||||
{
|
{
|
||||||
core_server_config *sconf =
|
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;
|
char *dir = sconf->gprof_dir;
|
||||||
const char *use_dir;
|
const char *use_dir;
|
||||||
|
|
||||||
|
@@ -293,8 +293,7 @@ static unsigned int __stdcall winnt_accept(void *lr_)
|
|||||||
#endif
|
#endif
|
||||||
u_long zero = 0;
|
u_long zero = 0;
|
||||||
|
|
||||||
core_sconf = ap_get_module_config(ap_server_conf->module_config,
|
core_sconf = ap_get_core_module_config(ap_server_conf->module_config);
|
||||||
&core_module);
|
|
||||||
accf_name = apr_table_get(core_sconf->accf_map, lr->protocol);
|
accf_name = apr_table_get(core_sconf->accf_map, lr->protocol);
|
||||||
|
|
||||||
if (strcmp(accf_name, "data") == 0)
|
if (strcmp(accf_name, "data") == 0)
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include "httpd.h"
|
#include "httpd.h"
|
||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
|
#include "http_core.h"
|
||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
#include "http_main.h"
|
#include "http_main.h"
|
||||||
#include "mpm_common.h"
|
#include "mpm_common.h"
|
||||||
@@ -56,7 +57,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#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
|
#if AP_ENABLE_EXCEPTION_HOOK
|
||||||
APR_HOOK_STRUCT(
|
APR_HOOK_STRUCT(
|
||||||
|
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include "httpd.h"
|
#include "httpd.h"
|
||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
|
#include "http_core.h"
|
||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
#include "http_main.h"
|
#include "http_main.h"
|
||||||
#include "mpm_common.h"
|
#include "mpm_common.h"
|
||||||
@@ -58,7 +59,9 @@
|
|||||||
#endif
|
#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;
|
typedef enum {DO_NOTHING, SEND_SIGTERM, SEND_SIGKILL, GIVEUP} action_t;
|
||||||
|
|
||||||
|
@@ -56,8 +56,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* we know core's module_index is 0 */
|
||||||
APLOG_USE_MODULE(core);
|
#undef APLOG_MODULE_INDEX
|
||||||
|
#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
|
||||||
|
|
||||||
APR_HOOK_STRUCT(
|
APR_HOOK_STRUCT(
|
||||||
APR_HOOK_LINK(pre_read_request)
|
APR_HOOK_LINK(pre_read_request)
|
||||||
@@ -107,8 +108,7 @@ AP_DECLARE(const char *)ap_make_content_type(request_rec *r, const char *type)
|
|||||||
{
|
{
|
||||||
const apr_strmatch_pattern **pcset;
|
const apr_strmatch_pattern **pcset;
|
||||||
core_dir_config *conf =
|
core_dir_config *conf =
|
||||||
(core_dir_config *)ap_get_module_config(r->per_dir_config,
|
(core_dir_config *)ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
core_request_config *request_conf;
|
core_request_config *request_conf;
|
||||||
apr_size_t type_len;
|
apr_size_t type_len;
|
||||||
|
|
||||||
@@ -120,8 +120,7 @@ AP_DECLARE(const char *)ap_make_content_type(request_rec *r, const char *type)
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
request_conf =
|
request_conf = ap_get_core_module_config(r->request_config);
|
||||||
ap_get_module_config(r->request_config, &core_module);
|
|
||||||
if (request_conf->suppress_charset) {
|
if (request_conf->suppress_charset) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@@ -954,7 +953,7 @@ request_rec *ap_read_request(conn_rec *conn)
|
|||||||
* to the normal timeout mode as we fetch the header lines,
|
* to the normal timeout mode as we fetch the header lines,
|
||||||
* as necessary.
|
* 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);
|
apr_socket_timeout_get(csd, &cur_timeout);
|
||||||
if (cur_timeout != conn->base_server->timeout) {
|
if (cur_timeout != conn->base_server->timeout) {
|
||||||
apr_socket_timeout_set(csd, conn->base_server->timeout);
|
apr_socket_timeout_set(csd, conn->base_server->timeout);
|
||||||
|
@@ -54,7 +54,9 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#endif
|
#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_STRUCT(
|
||||||
APR_HOOK_LINK(translate_name)
|
APR_HOOK_LINK(translate_name)
|
||||||
@@ -122,7 +124,7 @@ AP_DECLARE(int) ap_process_request_internal(request_rec *r)
|
|||||||
|
|
||||||
/* Ignore embedded %2F's in path for proxy requests */
|
/* Ignore embedded %2F's in path for proxy requests */
|
||||||
if (!r->proxyreq && r->parsed_uri.path) {
|
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) {
|
if (d->allow_encoded_slashes) {
|
||||||
access_status = ap_unescape_url_keep2f(r->parsed_uri.path, d->decode_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_internal(request_rec *r)
|
|||||||
return access_status;
|
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) {
|
if (d->log) {
|
||||||
r->log = d->log;
|
r->log = d->log;
|
||||||
}
|
}
|
||||||
@@ -184,7 +186,7 @@ AP_DECLARE(int) ap_process_request_internal(request_rec *r)
|
|||||||
return access_status;
|
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) {
|
if (d->log) {
|
||||||
r->log = 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)
|
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) {
|
if (!this_dir) {
|
||||||
return;
|
return;
|
||||||
@@ -532,8 +534,8 @@ static void core_opts_merge(const ap_conf_vector_t *sec, core_opts_t *opts)
|
|||||||
AP_DECLARE(int) ap_directory_walk(request_rec *r)
|
AP_DECLARE(int) ap_directory_walk(request_rec *r)
|
||||||
{
|
{
|
||||||
ap_conf_vector_t *now_merged = NULL;
|
ap_conf_vector_t *now_merged = NULL;
|
||||||
core_server_config *sconf = ap_get_module_config(r->server->module_config,
|
core_server_config *sconf =
|
||||||
&core_module);
|
ap_get_core_module_config(r->server->module_config);
|
||||||
ap_conf_vector_t **sec_ent = (ap_conf_vector_t **) sconf->sec_dir->elts;
|
ap_conf_vector_t **sec_ent = (ap_conf_vector_t **) sconf->sec_dir->elts;
|
||||||
int num_sec = sconf->sec_dir->nelts;
|
int num_sec = sconf->sec_dir->nelts;
|
||||||
walk_cache_t *cache;
|
walk_cache_t *cache;
|
||||||
@@ -649,7 +651,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
|
|||||||
allow_options_t opts;
|
allow_options_t opts;
|
||||||
core_dir_config *this_dir;
|
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;
|
opts = this_dir->opts;
|
||||||
/*
|
/*
|
||||||
* If Symlinks are allowed in general we do not need the following
|
* If Symlinks are allowed in general we do not need the following
|
||||||
@@ -732,7 +734,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
|
|||||||
* We didn't start the merge from r->per_dir_config, so we
|
* We didn't start the merge from r->per_dir_config, so we
|
||||||
* accumulate opts and override as we merge, from the globals.
|
* 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.opts = this_dir->opts;
|
||||||
opts.add = this_dir->opts_add;
|
opts.add = this_dir->opts_add;
|
||||||
opts.remove = this_dir->opts_remove;
|
opts.remove = this_dir->opts_remove;
|
||||||
@@ -873,7 +875,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
|
|||||||
|
|
||||||
ap_conf_vector_t *entry_config = sec_ent[sec_idx];
|
ap_conf_vector_t *entry_config = sec_ent[sec_idx];
|
||||||
core_dir_config *entry_core;
|
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?
|
/* No more possible matches for this many segments?
|
||||||
* We are done when we find relative/regex/longer components.
|
* We are done when we find relative/regex/longer components.
|
||||||
@@ -1169,7 +1171,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
|
|||||||
for (; sec_idx < num_sec; ++sec_idx) {
|
for (; sec_idx < num_sec; ++sec_idx) {
|
||||||
|
|
||||||
core_dir_config *entry_core;
|
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) {
|
if (!entry_core->r) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1292,8 +1294,8 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
|
|||||||
AP_DECLARE(int) ap_location_walk(request_rec *r)
|
AP_DECLARE(int) ap_location_walk(request_rec *r)
|
||||||
{
|
{
|
||||||
ap_conf_vector_t *now_merged = NULL;
|
ap_conf_vector_t *now_merged = NULL;
|
||||||
core_server_config *sconf = ap_get_module_config(r->server->module_config,
|
core_server_config *sconf =
|
||||||
&core_module);
|
ap_get_core_module_config(r->server->module_config);
|
||||||
ap_conf_vector_t **sec_ent = (ap_conf_vector_t **)sconf->sec_url->elts;
|
ap_conf_vector_t **sec_ent = (ap_conf_vector_t **)sconf->sec_url->elts;
|
||||||
int num_sec = sconf->sec_url->nelts;
|
int num_sec = sconf->sec_url->nelts;
|
||||||
walk_cache_t *cache;
|
walk_cache_t *cache;
|
||||||
@@ -1365,7 +1367,7 @@ AP_DECLARE(int) ap_location_walk(request_rec *r)
|
|||||||
for (sec_idx = 0; sec_idx < num_sec; ++sec_idx) {
|
for (sec_idx = 0; sec_idx < num_sec; ++sec_idx) {
|
||||||
|
|
||||||
core_dir_config *entry_core;
|
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 */
|
/* ### const strlen can be optimized in location config parsing */
|
||||||
len = strlen(entry_core->d);
|
len = strlen(entry_core->d);
|
||||||
@@ -1457,8 +1459,7 @@ AP_DECLARE(int) ap_location_walk(request_rec *r)
|
|||||||
AP_DECLARE(int) ap_file_walk(request_rec *r)
|
AP_DECLARE(int) ap_file_walk(request_rec *r)
|
||||||
{
|
{
|
||||||
ap_conf_vector_t *now_merged = NULL;
|
ap_conf_vector_t *now_merged = NULL;
|
||||||
core_dir_config *dconf = ap_get_module_config(r->per_dir_config,
|
core_dir_config *dconf = ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
ap_conf_vector_t **sec_ent = NULL;
|
ap_conf_vector_t **sec_ent = NULL;
|
||||||
int num_sec = 0;
|
int num_sec = 0;
|
||||||
walk_cache_t *cache;
|
walk_cache_t *cache;
|
||||||
@@ -1539,7 +1540,7 @@ AP_DECLARE(int) ap_file_walk(request_rec *r)
|
|||||||
*/
|
*/
|
||||||
for (sec_idx = 0; sec_idx < num_sec; ++sec_idx) {
|
for (sec_idx = 0; sec_idx < num_sec; ++sec_idx) {
|
||||||
core_dir_config *entry_core;
|
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
|
if (entry_core->r
|
||||||
? ap_regexec(entry_core->r, cache->cached , 0, NULL, 0)
|
? ap_regexec(entry_core->r, cache->cached , 0, NULL, 0)
|
||||||
@@ -1619,8 +1620,7 @@ AP_DECLARE(int) ap_file_walk(request_rec *r)
|
|||||||
AP_DECLARE(int) ap_if_walk(request_rec *r)
|
AP_DECLARE(int) ap_if_walk(request_rec *r)
|
||||||
{
|
{
|
||||||
ap_conf_vector_t *now_merged = NULL;
|
ap_conf_vector_t *now_merged = NULL;
|
||||||
core_dir_config *dconf = ap_get_module_config(r->per_dir_config,
|
core_dir_config *dconf = ap_get_core_module_config(r->per_dir_config);
|
||||||
&core_module);
|
|
||||||
ap_conf_vector_t **sec_ent = NULL;
|
ap_conf_vector_t **sec_ent = NULL;
|
||||||
int num_sec = 0;
|
int num_sec = 0;
|
||||||
walk_cache_t *cache;
|
walk_cache_t *cache;
|
||||||
@@ -1658,7 +1658,7 @@ AP_DECLARE(int) ap_if_walk(request_rec *r)
|
|||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
core_dir_config *entry_core;
|
core_dir_config *entry_core;
|
||||||
int rc;
|
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);
|
AP_DEBUG_ASSERT(entry_core->condition_ifelse != 0);
|
||||||
if (entry_core->condition_ifelse & AP_CONDITION_ELSE) {
|
if (entry_core->condition_ifelse & AP_CONDITION_ELSE) {
|
||||||
|
@@ -36,7 +36,9 @@
|
|||||||
|
|
||||||
#include "scoreboard.h"
|
#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 scoreboard *ap_scoreboard_image = NULL;
|
||||||
AP_DECLARE_DATA const char *ap_scoreboard_fname = NULL;
|
AP_DECLARE_DATA const char *ap_scoreboard_fname = NULL;
|
||||||
|
@@ -52,6 +52,7 @@
|
|||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
#include "http_protocol.h"
|
#include "http_protocol.h"
|
||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
|
#include "http_core.h"
|
||||||
#include "util_ebcdic.h"
|
#include "util_ebcdic.h"
|
||||||
|
|
||||||
#ifdef HAVE_PWD_H
|
#ifdef HAVE_PWD_H
|
||||||
@@ -85,7 +86,9 @@
|
|||||||
#define SLASHES "/"
|
#define SLASHES "/"
|
||||||
#endif
|
#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
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -18,11 +18,14 @@
|
|||||||
#include "apr_lib.h"
|
#include "apr_lib.h"
|
||||||
#include "apr_strings.h"
|
#include "apr_strings.h"
|
||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
|
#include "http_core.h"
|
||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
|
|
||||||
#define LOG_PREFIX "ap_cookie: "
|
#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.
|
* Write an RFC2109 compliant cookie.
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "httpd.h"
|
#include "httpd.h"
|
||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
|
#include "http_core.h"
|
||||||
|
|
||||||
/* Possibly get rid of the macros we defined in httpd.h */
|
/* Possibly get rid of the macros we defined in httpd.h */
|
||||||
#if defined(strchr)
|
#if defined(strchr)
|
||||||
@@ -106,6 +107,17 @@ AP_DECLARE(void *) ap_get_module_config(const ap_conf_vector_t *cv,
|
|||||||
return ((void **)cv)[m->module_index];
|
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)
|
#if defined(ap_get_server_module_loglevel)
|
||||||
#undef 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);
|
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_conf_vector_t *cv, const module *m,
|
|||||||
{
|
{
|
||||||
((void **)cv)[m->module_index] = val;
|
((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;
|
||||||
|
}
|
||||||
|
@@ -24,7 +24,9 @@
|
|||||||
#include "http_core.h"
|
#include "http_core.h"
|
||||||
#include "util_ebcdic.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)
|
apr_status_t ap_init_ebcdic(apr_pool_t *pool)
|
||||||
{
|
{
|
||||||
|
@@ -29,7 +29,9 @@
|
|||||||
#include "apr_lib.h"
|
#include "apr_lib.h"
|
||||||
#include "apr_fnmatch.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_STRUCT(
|
||||||
APR_HOOK_LINK(expr_lookup)
|
APR_HOOK_LINK(expr_lookup)
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "httpd.h"
|
#include "httpd.h"
|
||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
|
#include "http_core.h"
|
||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
#include "util_filter.h"
|
#include "util_filter.h"
|
||||||
|
|
||||||
@@ -45,7 +46,9 @@
|
|||||||
* filter names to filters
|
* 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;
|
typedef struct filter_trie_node filter_trie_node;
|
||||||
|
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "httpd.h"
|
#include "httpd.h"
|
||||||
#include "http_main.h"
|
#include "http_main.h"
|
||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
|
#include "http_core.h"
|
||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
#include "util_mutex.h"
|
#include "util_mutex.h"
|
||||||
#if AP_NEED_SET_MUTEX_PERMS
|
#if AP_NEED_SET_MUTEX_PERMS
|
||||||
@@ -41,7 +42,9 @@
|
|||||||
#include <unistd.h> /* getpid() */
|
#include <unistd.h> /* getpid() */
|
||||||
#endif
|
#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,
|
AP_DECLARE(apr_status_t) ap_parse_mutex(const char *arg, apr_pool_t *pool,
|
||||||
apr_lockmech_e *mutexmech,
|
apr_lockmech_e *mutexmech,
|
||||||
|
@@ -52,7 +52,9 @@
|
|||||||
#define MALFORMED_MESSAGE "malformed header from script. Bad header="
|
#define MALFORMED_MESSAGE "malformed header from script. Bad header="
|
||||||
#define MALFORMED_HEADER_LENGTH_TO_SHOW 30
|
#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)
|
static char *http2env(request_rec *r, const char *w)
|
||||||
{
|
{
|
||||||
|
@@ -29,7 +29,9 @@
|
|||||||
#define READ_BLOCKSIZE 2048
|
#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)
|
AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc)
|
||||||
{
|
{
|
||||||
|
@@ -39,7 +39,9 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#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
|
* After all the definitions there's an explanation of how it's all put
|
||||||
|
Reference in New Issue
Block a user