Ignore:
Timestamp:
May 29, 2013, 1:13:40 AM (11 years ago)
Author:
tboning
Message:
Rebase Scripts httpd patches for httpd 2.4:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/fc19-dev/server/common/patches/httpd-fixup-vhost.patch

    r1602 r2422  
    1 commit 3b081163d6250d893838d69d9a83f217c341d657
    2 Author: Greg Brockman <gdb@mit.edu>
    3 Date:   Fri Aug 6 23:19:15 2010 -0400
     1From 2e62dad3d91280032b2130f02553c968d306edf5 Mon Sep 17 00:00:00 2001
     2From: Alexander Chernyakhovsky <achernya@mit.edu>
     3Date: Fri, 3 May 2013 22:43:28 -0400
     4Subject: [PATCH 4/4] Export method to fixup a single virtual host
    45
    5     Add method to merge virtual host with a main server_rec
     6Apache normally provides ap_fixup_virtual_hosts, which merges the
     7configuration from the main server into each virtual host.  Refactor
     8this code to allow merging the configuration into a single virtual
     9host, and export this method for use in mod_vhost_ldap.
     10
     11Additionally, call the newly created method in the loop in
     12ap_fixup_virtual_hosts.
     13---
     14 include/http_config.h |    9 ++++++++
     15 server/config.c       |   58 +++++++++++++++++++++++++++----------------------
     16 2 files changed, 41 insertions(+), 26 deletions(-)
    617
    718diff --git a/include/http_config.h b/include/http_config.h
    8 index 5e9fd51..8e6f247 100644
     19index 7ee3760..e3657ea 100644
    920--- a/include/http_config.h
    1021+++ b/include/http_config.h
    11 @@ -827,6 +827,16 @@ AP_DECLARE(void) ap_register_hooks(module *m, apr_pool_t *p);
    12  AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p,
     22@@ -1012,6 +1012,15 @@ AP_DECLARE(void) ap_register_hooks(module *m, apr_pool_t *p);
     23  */
     24 AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p,
    1325                                         server_rec *main_server);
    14  
    1526+/**
    16 + * Setup a single virtual host by merging the main server_rec into it.
     27+ * Setup all virtual hosts
    1728+ * @param p The pool to allocate from
    18 + * @param main_server The server_rec with which to merge
    19 + * @param virt The virtual host server_rec with some set of directives to override already set
     29+ * @param main_server The head of the server_rec list
     30+ * @param virt The individual virtual host to fix
    2031+ */
    2132+AP_DECLARE(void) ap_fixup_virtual_host(apr_pool_t *p,
    2233+                                      server_rec *main_server,
    2334+                                      server_rec *virt);
    24 +
    25  /* For http_request.c... */
    2635 
    2736 /**
     37  * Reserve some modules slots for modules loaded by other means than
    2838diff --git a/server/config.c b/server/config.c
    29 index 101d0e4..ef0f2ba 100644
     39index bc0804a..488954d 100644
    3040--- a/server/config.c
    3141+++ b/server/config.c
    32 @@ -1902,38 +1902,43 @@ AP_CORE_DECLARE(const char *) ap_init_virtual_host(apr_pool_t *p,
     42@@ -2246,46 +2246,52 @@ AP_DECLARE(void) ap_merge_log_config(const struct ap_logconf *old_conf,
     43     }
    3344 }
    34  
    3545 
    3646-AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server)
    3747+AP_DECLARE(void) ap_fixup_virtual_host(apr_pool_t *p, server_rec *main_server,
    38 +                                       server_rec *virt)
     48+                                      server_rec *virt)
    3949 {
    4050-    server_rec *virt;
    41 +    merge_server_configs(p, main_server->module_config,
    42 +                         virt->module_config);
     51     core_dir_config *dconf =
     52         ap_get_core_module_config(main_server->lookup_defaults);
     53     dconf->log = &main_server->log;
    4354 
    4455-    for (virt = main_server->next; virt; virt = virt->next) {
    4556-        merge_server_configs(p, main_server->module_config,
    4657-                             virt->module_config);
    47 +    virt->lookup_defaults =
    48 +        ap_merge_per_dir_configs(p, main_server->lookup_defaults,
    49 +                                 virt->lookup_defaults);
     58+    merge_server_configs(p, main_server->module_config,
     59+                        virt->module_config);
    5060 
    5161-        virt->lookup_defaults =
    5262-            ap_merge_per_dir_configs(p, main_server->lookup_defaults,
    5363-                                     virt->lookup_defaults);
    54 +    if (virt->server_admin == NULL)
    55 +        virt->server_admin = main_server->server_admin;
     64+    virt->lookup_defaults =
     65+       ap_merge_per_dir_configs(p, main_server->lookup_defaults,
     66+                                virt->lookup_defaults);
    5667 
    5768-        if (virt->server_admin == NULL)
    5869-            virt->server_admin = main_server->server_admin;
    59 +    if (virt->timeout == 0)
    60 +        virt->timeout = main_server->timeout;
     70+    if (virt->server_admin == NULL)
     71+       virt->server_admin = main_server->server_admin;
    6172 
    6273-        if (virt->timeout == 0)
    6374-            virt->timeout = main_server->timeout;
    64 +    if (virt->keep_alive_timeout == 0)
    65 +        virt->keep_alive_timeout = main_server->keep_alive_timeout;
     75+    if (virt->timeout == 0)
     76+       virt->timeout = main_server->timeout;
    6677 
    6778-        if (virt->keep_alive_timeout == 0)
    6879-            virt->keep_alive_timeout = main_server->keep_alive_timeout;
    69 +    if (virt->keep_alive == -1)
    70 +        virt->keep_alive = main_server->keep_alive;
     80+    if (virt->keep_alive_timeout == 0)
     81+       virt->keep_alive_timeout = main_server->keep_alive_timeout;
    7182 
    7283-        if (virt->keep_alive == -1)
    7384-            virt->keep_alive = main_server->keep_alive;
    74 +    if (virt->keep_alive_max == -1)
    75 +        virt->keep_alive_max = main_server->keep_alive_max;
     85+    if (virt->keep_alive == -1)
     86+       virt->keep_alive = main_server->keep_alive;
    7687 
    7788-        if (virt->keep_alive_max == -1)
    7889-            virt->keep_alive_max = main_server->keep_alive_max;
    79 +    /* XXX: this is really something that should be dealt with by a
    80 +     * post-config api phase
    81 +     */
    82 +    ap_core_reorder_directories(p, virt);
    83 +}
     90+    if (virt->keep_alive_max == -1)
     91+       virt->keep_alive_max = main_server->keep_alive_max;
     92 
     93-        ap_merge_log_config(&main_server->log, &virt->log);
     94+    ap_merge_log_config(&main_server->log, &virt->log);
     95 
     96-        dconf = ap_get_core_module_config(virt->lookup_defaults);
     97-        dconf->log = &virt->log;
     98+    dconf = ap_get_core_module_config(virt->lookup_defaults);
     99+    dconf->log = &virt->log;
    84100 
    85101-        /* XXX: this is really something that should be dealt with by a
     
    88104-        ap_core_reorder_directories(p, virt);
    89105-    }
     106+    /* XXX: this is really something that should be dealt with by a
     107+     * post-config api phase
     108+     */
     109+    ap_core_reorder_directories(p, virt);
     110+}
     111+
    90112+AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server)
    91113+{
    92114+    server_rec *virt;
    93 +
     115+   
    94116+    for (virt = main_server->next; virt; virt = virt->next)
    95117+        ap_fixup_virtual_host(p, main_server, virt);
     
    97119     ap_core_reorder_directories(p, main_server);
    98120 }
     121--
     1221.7.9.6 (Apple Git-31.1)
     123
Note: See TracChangeset for help on using the changeset viewer.