source:
trunk/server/common/patches/httpd-fixup-vhost.patch
@
2731
Last change on this file since 2731 was 2591, checked in by achernya, 10 years ago | |
---|---|
File size: 4.4 KB |
-
include/http_config.h
From e90c8e59a93e5dde747e6dec7b960d2a6f2523ab Mon Sep 17 00:00:00 2001 From: Alexander Chernyakhovsky <achernya@mit.edu> Date: Fri, 3 May 2013 22:43:28 -0400 Subject: [PATCH] Export method to fixup a single virtual host Apache normally provides ap_fixup_virtual_hosts, which merges the configuration from the main server into each virtual host. Refactor this code to allow merging the configuration into a single virtual host, and export this method for use in mod_vhost_ldap. Additionally, call the newly created method in the loop in ap_fixup_virtual_hosts. --- include/http_config.h | 9 ++++++++ server/config.c | 58 ++++++++++++++++++++++++++++----------------------- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/include/http_config.h b/include/http_config.h index 7ee3760..e3657ea 100644
a b AP_DECLARE(void) ap_register_hooks(module *m, apr_pool_t *p); 1012 1012 */ 1013 1013 AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, 1014 1014 server_rec *main_server); 1015 /** 1016 * Setup all virtual hosts 1017 * @param p The pool to allocate from 1018 * @param main_server The head of the server_rec list 1019 * @param virt The individual virtual host to fix 1020 */ 1021 AP_DECLARE(void) ap_fixup_virtual_host(apr_pool_t *p, 1022 server_rec *main_server, 1023 server_rec *virt); 1015 1024 1016 1025 /** 1017 1026 * Reserve some modules slots for modules loaded by other means than -
server/config.c
diff --git a/server/config.c b/server/config.c index c1aae17..254c5d2 100644
a b AP_DECLARE(void) ap_merge_log_config(const struct ap_logconf *old_conf, 2245 2245 } 2246 2246 } 2247 2247 2248 AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server) 2248 AP_DECLARE(void) ap_fixup_virtual_host(apr_pool_t *p, server_rec *main_server, 2249 server_rec *virt) 2249 2250 { 2250 server_rec *virt;2251 2251 core_dir_config *dconf = 2252 2252 ap_get_core_module_config(main_server->lookup_defaults); 2253 2253 dconf->log = &main_server->log; 2254 2254 2255 for (virt = main_server->next; virt; virt = virt->next) { 2256 merge_server_configs(p, main_server->module_config, 2257 virt->module_config); 2255 merge_server_configs(p, main_server->module_config, 2256 virt->module_config); 2258 2257 2259 2260 2261 2258 virt->lookup_defaults = 2259 ap_merge_per_dir_configs(p, main_server->lookup_defaults, 2260 virt->lookup_defaults); 2262 2261 2263 2264 2262 if (virt->server_admin == NULL) 2263 virt->server_admin = main_server->server_admin; 2265 2264 2266 2267 2265 if (virt->timeout == 0) 2266 virt->timeout = main_server->timeout; 2268 2267 2269 2270 2268 if (virt->keep_alive_timeout == 0) 2269 virt->keep_alive_timeout = main_server->keep_alive_timeout; 2271 2270 2272 2273 2271 if (virt->keep_alive == -1) 2272 virt->keep_alive = main_server->keep_alive; 2274 2273 2275 2276 2274 if (virt->keep_alive_max == -1) 2275 virt->keep_alive_max = main_server->keep_alive_max; 2277 2276 2278 2277 ap_merge_log_config(&main_server->log, &virt->log); 2279 2278 2280 2281 2279 dconf = ap_get_core_module_config(virt->lookup_defaults); 2280 dconf->log = &virt->log; 2282 2281 2283 /* XXX: this is really something that should be dealt with by a 2284 * post-config api phase 2285 */ 2286 ap_core_reorder_directories(p, virt); 2287 } 2282 /* XXX: this is really something that should be dealt with by a 2283 * post-config api phase 2284 */ 2285 ap_core_reorder_directories(p, virt); 2286 } 2287 2288 AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server) 2289 { 2290 server_rec *virt; 2291 2292 for (virt = main_server->next; virt; virt = virt->next) 2293 ap_fixup_virtual_host(p, main_server, virt); 2288 2294 2289 2295 ap_core_reorder_directories(p, main_server); 2290 2296 }
Note: See TracBrowser
for help on using the repository browser.