www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: mod_log-any/2090: LogFormat directives are not "inherited"
Date Tue, 09 Jun 1998 04:50:00 GMT
The following reply was made to PR mod_log-any/2090; it has been noted by GNATS.

From: Dean Gaudet <dgaudet@arctic.org>
To: "M.D.Parker" <mdpc@netcom.com>
Cc: apbugs@hyperreal.org
Subject: Re: mod_log-any/2090: LogFormat directives are not "inherited"
Date: Mon, 8 Jun 1998 21:45:36 -0700 (PDT)

 Here is a patch provided by Christof Damian <damian@mediaconsult.com>.  It
 has been applied to 1.3.1-dev... you can pick up a snapshot at
 ftp://dev.apache.org/httpd/from-cvs/ in a few hours. 
 
 Tell me if it solves your problem.
 
 Thanks
 Dean
 
 *** mod_log_config.c-orig	Sun Jun  7 12:28:50 1998
 --- mod_log_config.c	Sun Jun  7 12:48:36 1998
 ***************
 *** 215,220 ****
 --- 215,221 ----
    */
   
   typedef struct {
 +     char *default_format_string;
       array_header *default_format;
       array_header *config_logs;
       array_header *server_config_logs;
 ***************
 *** 232,237 ****
 --- 233,239 ----
   
   typedef struct {
       char *fname;
 +     char *format_string;
       array_header *format;
       int log_fd;
   #ifdef BUFFERED_LOGS
 ***************
 *** 782,787 ****
 --- 784,790 ----
       multi_log_state *mls = (multi_log_state *) ap_palloc(p, sizeof(multi_log_state));
   
       mls->config_logs = ap_make_array(p, 1, sizeof(config_log_state));
 +     mls->default_format_string = NULL;
       mls->default_format = NULL;
       mls->server_config_logs = NULL;
       mls->formats = ap_make_table(p, 4);
 ***************
 *** 800,812 ****
 --- 803,841 ----
   {
       multi_log_state *base = (multi_log_state *) basev;
       multi_log_state *add = (multi_log_state *) addv;
 +     char *format;
 +     const char *dummy;
   
       add->server_config_logs = base->config_logs;
       if (!add->default_format) {
 +         add->default_format_string = base->default_format_string;
           add->default_format = base->default_format;
       }
       add->formats = ap_overlay_tables(p, base->formats, add->formats);
   
 +     if (add->default_format_string) {
 +       format = ap_table_get(add->formats, add->default_format_string);
 +       if (format) {
 +         add->default_format = parse_log_string(p, format, &dummy);
 +       };
 +     }    
 + 
 +     if (add->config_logs) {
 +       config_log_state *clsarray = (config_log_state *) add->config_logs->elts;
 +       int i;
 + 
 +       for (i = 0; i < add->config_logs->nelts; ++i) {
 +         config_log_state *cls = &clsarray[i];
 + 
 +         if (cls->format_string) {
 +           format = ap_table_get(add->formats, cls->format_string);
 +           if (format) {
 +             cls->format = parse_log_string(p, format , &dummy);
 +           }
 +         }
 +       }
 +     }
 + 
       return add;
   }
   
 ***************
 *** 817,823 ****
                                 char *name)
   {
       const char *err_string = NULL;
 -     char *format;
       multi_log_state *mls = ap_get_module_config(cmd->server->module_config,
                                                &config_log_module);
   
 --- 846,851 ----
 ***************
 *** 833,846 ****
           }
       }
       else {
 !         /*
 !          * See if we were given a name rather than a format string.
 !          */
 !         format = ap_table_get(mls->formats, fmt);
 !         if (format == NULL) {
 !             format = fmt;
 !         }
 !         mls->default_format = parse_log_string(cmd->pool, format, &err_string);
       }
       return err_string;
   }
 --- 861,868 ----
           }
       }
       else {
 !         mls->default_format_string = fmt;
 !         mls->default_format = parse_log_string(cmd->pool, fmt, &err_string);
       }
       return err_string;
   }
 ***************
 *** 852,868 ****
       multi_log_state *mls = ap_get_module_config(cmd->server->module_config,
                                                &config_log_module);
       config_log_state *cls;
 -     char *format;
   
       cls = (config_log_state *) ap_push_array(mls->config_logs);
       cls->fname = fn;
       if (!fmt) {
           cls->format = NULL;
       }
       else {
 !         format = ap_table_get(mls->formats, fmt);
 !         format = (format != NULL) ? format : fmt;
 !         cls->format = parse_log_string(cmd->pool, format, &err_string);
       }
       cls->log_fd = -1;
   
 --- 874,888 ----
       multi_log_state *mls = ap_get_module_config(cmd->server->module_config,
                                                &config_log_module);
       config_log_state *cls;
   
       cls = (config_log_state *) ap_push_array(mls->config_logs);
       cls->fname = fn;
 +     cls->format_string = fmt;
       if (!fmt) {
           cls->format = NULL;
       }
       else {
 !         cls->format = parse_log_string(cmd->pool, fmt, &err_string);
       }
       cls->log_fd = -1;
   
 
 

Mime
View raw message