Commit a64ac14e authored by Bill Stoddard's avatar Bill Stoddard
Browse files

Fix seg fault at start-up introduced by Ryan's change to enabl

modules to specify their own logging tags. mod_log_config
registers an optional function, ap_register_log_handler().
ap_register_log_handler() was being called by http_core before
the directive hash table was created. This patch creates the
directive hash table before ap_register_log_handler() is
registered as an optional function.

Submitted by:  [jean-frederic clere <jfrederic.clere@fujitsu-siemens.com>]
Reviewed by:  Jeff Trawick, Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88904 13f79535-47bb-0310-9956-ffa450edef68
parent 3e6be42d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
Changes with Apache 2.0.18-dev
  *) Fix seg fault at start-up introduced by Ryan's change to enable
     modules to specify their own logging tags. mod_log_config
     registers an optional function, ap_register_log_handler().
     ap_register_log_handler() was being called by http_core before
     the directive hash table was created. This patch creates the
     directive hash table before ap_register_log_handler() is
     registered as an optional function.
     [jean-frederic clere <jfrederic.clere@fujitsu-siemens.com>]

  *) Add ap_set_int_slot() function
     [John K. Sterling <sterling@covalent.net>]
+7 −1
Original line number Diff line number Diff line
@@ -1155,7 +1155,6 @@ static void log_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
{
    static APR_OPTIONAL_FN_TYPE(ap_register_log_handler) *log_pfn_register;

    log_hash = apr_hash_make(p);
    log_pfn_register = APR_RETRIEVE_OPTIONAL_FN(ap_register_log_handler);

    if (log_pfn_register) {
@@ -1195,6 +1194,13 @@ static void register_hooks(apr_pool_t *p)
    ap_hook_open_logs(init_config_log,NULL,NULL,APR_HOOK_MIDDLE);
    ap_hook_log_transaction(multi_log_transaction,NULL,NULL,APR_HOOK_MIDDLE);

    /* Init log_hash before we register the optional function. It is 
     * possible for the optional function, ap_register_log_handler,
     * to be called before any other mod_log_config hooks are called.
     * As a policy, we should init everything required by an optional function
     * before calling APR_REGISTER_OPTIONAL_FN.
     */ 
    log_hash = apr_hash_make(p);
    APR_REGISTER_OPTIONAL_FN(ap_register_log_handler);
}