source:
branches/fc19-dev/server/common/patches/httpd-fixup-vhost.patch
@
2424
Last change on this file since 2424 was 2422, checked in by tboning, 11 years ago | |
---|---|
File size: 4.4 KB |
-
include/http_config.h
From 2e62dad3d91280032b2130f02553c968d306edf5 Mon Sep 17 00:00:00 2001 From: Alexander Chernyakhovsky <achernya@mit.edu> Date: Fri, 3 May 2013 22:43:28 -0400 Subject: [PATCH 4/4] 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 bc0804a..488954d 100644
a b AP_DECLARE(void) ap_merge_log_config(const struct ap_logconf *old_conf, 2246 2246 } 2247 2247 } 2248 2248 2249 AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server) 2249 AP_DECLARE(void) ap_fixup_virtual_host(apr_pool_t *p, server_rec *main_server, 2250 server_rec *virt) 2250 2251 { 2251 server_rec *virt;2252 2252 core_dir_config *dconf = 2253 2253 ap_get_core_module_config(main_server->lookup_defaults); 2254 2254 dconf->log = &main_server->log; 2255 2255 2256 for (virt = main_server->next; virt; virt = virt->next) { 2257 merge_server_configs(p, main_server->module_config, 2258 virt->module_config); 2256 merge_server_configs(p, main_server->module_config, 2257 virt->module_config); 2259 2258 2260 2261 2262 2259 virt->lookup_defaults = 2260 ap_merge_per_dir_configs(p, main_server->lookup_defaults, 2261 virt->lookup_defaults); 2263 2262 2264 2265 2263 if (virt->server_admin == NULL) 2264 virt->server_admin = main_server->server_admin; 2266 2265 2267 2268 2266 if (virt->timeout == 0) 2267 virt->timeout = main_server->timeout; 2269 2268 2270 2271 2269 if (virt->keep_alive_timeout == 0) 2270 virt->keep_alive_timeout = main_server->keep_alive_timeout; 2272 2271 2273 2274 2272 if (virt->keep_alive == -1) 2273 virt->keep_alive = main_server->keep_alive; 2275 2274 2276 2277 2275 if (virt->keep_alive_max == -1) 2276 virt->keep_alive_max = main_server->keep_alive_max; 2278 2277 2279 2278 ap_merge_log_config(&main_server->log, &virt->log); 2280 2279 2281 2282 2280 dconf = ap_get_core_module_config(virt->lookup_defaults); 2281 dconf->log = &virt->log; 2283 2282 2284 /* XXX: this is really something that should be dealt with by a 2285 * post-config api phase 2286 */ 2287 ap_core_reorder_directories(p, virt); 2288 } 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 } 2288 2289 AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server) 2290 { 2291 server_rec *virt; 2292 2293 for (virt = main_server->next; virt; virt = virt->next) 2294 ap_fixup_virtual_host(p, main_server, virt); 2289 2295 2290 2296 ap_core_reorder_directories(p, main_server); 2291 2297 }
Note: See TracBrowser
for help on using the repository browser.