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" (fwd)
Date Wed, 17 Jun 1998 06: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: apbugs@apache.org
Cc:  Subject: Re: mod_log-any/2090: LogFormat directives are not "inherited" (fwd)
Date: Tue, 16 Jun 1998 23:51:55 -0700 (PDT)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
   Send mail to mime@docserver.cac.washington.edu for more info.
 
 --------------23269446CC34D6EBA8014F75
 Content-Type: TEXT/PLAIN; CHARSET=us-ascii
 Content-ID: <Pine.LNX.3.96dg4.980616235152.22555I@twinlark.arctic.org>
 
 
 
 ---------- Forwarded message ----------
 Date: Thu, 11 Jun 1998 10:00:31 +0100
 From: Christof Damian <damian@mediaconsult.com>
 Organization: mediaconsult ltd.
 To: Dean Gaudet <dgaudet@arctic.org>
 Cc: Johnie Ingram <johnie@debian.org>
 Subject: Re: mod_log-any/2090: LogFormat directives are not "inherited"
 
 Dean Gaudet wrote:
 > 
 > Christof -- a small bug in your patch.  I think you need to delay the
 > parsing of log formats until the open_multi_logs point like I suggested,
 > rather than in the merging point... because the main server is never
 > merged (there's nothing to merge into it).  Can I trouble you to fix that?
 > :)
 
 ups - I thought I checked that.
 
 Attached is a patch against 1.60 (cvs tree) and one against 1.59 (1.3.0)
 I don't know which one you prefer.
 
 damian
 -- 
 Christof Damian                
 Technical Director             
 http://www.mediaconsult.com/     ( btw: mediaconsult is hiring )
 
 --------------23269446CC34D6EBA8014F75
 Content-Type: TEXT/PLAIN; CHARSET=us-ascii; NAME="diff-1.59"
 Content-ID: <Pine.LNX.3.96dg4.980616235152.22555J@twinlark.arctic.org>
 Content-Description: 
 
 Index: src/modules/standard/mod_log_config.c
 ===================================================================
 RCS file: /cvs/apache-1.3/src/modules/standard/mod_log_config.c,v
 retrieving revision 1.59
 diff -c -r1.59 mod_log_config.c
 *** mod_log_config.c	1998/05/29 08:18:51	1.59
 --- mod_log_config.c	1998/06/11 08:54:02
 ***************
 *** 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);
 ***************
 *** 803,808 ****
 --- 806,812 ----
   
       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);
 ***************
 *** 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);
   
 --- 821,826 ----
 ***************
 *** 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;
   }
 --- 836,843 ----
           }
       }
       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;
   
 --- 849,863 ----
       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;
   
 ***************
 *** 935,940 ****
 --- 930,943 ----
                                                &config_log_module);
       config_log_state *clsarray;
       const char *dummy;
 +     char *format;
 + 
 +     if (mls->default_format_string) {
 + 	format = ap_table_get(mls->formats, mls->default_format_string);
 + 	if (format) {
 + 	    mls->default_format = parse_log_string(p, format, &dummy);
 + 	}
 +     }    
   
       if (!mls->default_format) {
           mls->default_format = parse_log_string(p, DEFAULT_LOG_FORMAT, &dummy);
 ***************
 *** 945,950 ****
 --- 948,960 ----
           for (i = 0; i < mls->config_logs->nelts; ++i) {
               config_log_state *cls = &clsarray[i];
   
 + 	    if (cls->format_string) {
 + 		format = ap_table_get(mls->formats, cls->format_string);
 + 		if (format) {
 + 		    cls->format = parse_log_string(p, format, &dummy);
 + 		}
 + 	    }
 + 
               cls = open_config_log(s, p, cls, mls->default_format);
           }
       }
 ***************
 *** 952,957 ****
 --- 962,974 ----
           clsarray = (config_log_state *) mls->server_config_logs->elts;
           for (i = 0; i < mls->server_config_logs->nelts; ++i) {
               config_log_state *cls = &clsarray[i];
 + 
 + 	    if (cls->format_string) {
 + 		format = ap_table_get(mls->formats, cls->format_string);
 + 		if (format) {
 + 		    cls->format = parse_log_string(p, format, &dummy);
 + 		}
 + 	    }
   
               cls = open_config_log(s, p, cls, mls->default_format);
           }
 
 --------------23269446CC34D6EBA8014F75
 Content-Type: TEXT/PLAIN; CHARSET=us-ascii; NAME="diff-1.60"
 Content-ID: <Pine.LNX.3.96dg4.980616235152.22555K@twinlark.arctic.org>
 Content-Description: 
 
 Index: src/modules/standard/mod_log_config.c
 ===================================================================
 RCS file: /cvs/apache-1.3/src/modules/standard/mod_log_config.c,v
 retrieving revision 1.60
 diff -c -r1.60 mod_log_config.c
 *** mod_log_config.c	1998/06/09 04:36:47	1.60
 --- mod_log_config.c	1998/06/11 08:54:52
 ***************
 *** 803,810 ****
   {
       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) {
 --- 803,808 ----
 ***************
 *** 813,841 ****
       }
       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;
   }
   
 --- 811,816 ----
 ***************
 *** 955,960 ****
 --- 930,943 ----
                                                &config_log_module);
       config_log_state *clsarray;
       const char *dummy;
 +     char *format;
 + 
 +     if (mls->default_format_string) {
 + 	format = ap_table_get(mls->formats, mls->default_format_string);
 + 	if (format) {
 + 	    mls->default_format = parse_log_string(p, format, &dummy);
 + 	}
 +     }    
   
       if (!mls->default_format) {
           mls->default_format = parse_log_string(p, DEFAULT_LOG_FORMAT, &dummy);
 ***************
 *** 965,970 ****
 --- 948,960 ----
           for (i = 0; i < mls->config_logs->nelts; ++i) {
               config_log_state *cls = &clsarray[i];
   
 + 	    if (cls->format_string) {
 + 		format = ap_table_get(mls->formats, cls->format_string);
 + 		if (format) {
 + 		    cls->format = parse_log_string(p, format, &dummy);
 + 		}
 + 	    }
 + 
               cls = open_config_log(s, p, cls, mls->default_format);
           }
       }
 ***************
 *** 972,977 ****
 --- 962,974 ----
           clsarray = (config_log_state *) mls->server_config_logs->elts;
           for (i = 0; i < mls->server_config_logs->nelts; ++i) {
               config_log_state *cls = &clsarray[i];
 + 
 + 	    if (cls->format_string) {
 + 		format = ap_table_get(mls->formats, cls->format_string);
 + 		if (format) {
 + 		    cls->format = parse_log_string(p, format, &dummy);
 + 		}
 + 	    }
   
               cls = open_config_log(s, p, cls, mls->default_format);
           }
 
 --------------23269446CC34D6EBA8014F75--

Mime
View raw message