httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgau...@hyperreal.org
Subject cvs commit: apache-1.3/src/modules/standard mod_log_config.c
Date Tue, 09 Jun 1998 04:36:47 GMT
dgaudet     98/06/08 21:36:47

  Modified:    src      CHANGES
               src/modules/standard mod_log_config.c
  Log:
  fix the inheritance of log formats from main server to vhosts
  
  Submitted by:	Christof Damian <damian@mediaconsult.com>
  
  Revision  Changes    Path
  1.898     +3 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.897
  retrieving revision 1.898
  diff -u -r1.897 -r1.898
  --- CHANGES	1998/06/08 06:26:14	1.897
  +++ CHANGES	1998/06/09 04:36:44	1.898
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.1
   
  +  *) mod_log_config wouldn't let vhosts use log formats defined in the
  +     main server.  [Christof Damian <damian@mediaconsult.com>]
  +
     *) mod_usertrack was corrupting the client hostname.  As part of the
        fix, the cookie values were slightly extended to include the
        fully qualified hostname of the client.  [Dean Gaudet] PR#2229, 2366
  
  
  
  1.60      +33 -13    apache-1.3/src/modules/standard/mod_log_config.c
  
  Index: mod_log_config.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_config.c,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- mod_log_config.c	1998/05/29 08:18:51	1.59
  +++ mod_log_config.c	1998/06/09 04:36:47	1.60
  @@ -215,6 +215,7 @@
    */
   
   typedef struct {
  +    char *default_format_string;
       array_header *default_format;
       array_header *config_logs;
       array_header *server_config_logs;
  @@ -232,6 +233,7 @@
   
   typedef struct {
       char *fname;
  +    char *format_string;
       array_header *format;
       int log_fd;
   #ifdef BUFFERED_LOGS
  @@ -782,6 +784,7 @@
       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,13 +803,39 @@
   {
       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,7 +846,6 @@
                                 char *name)
   {
       const char *err_string = NULL;
  -    char *format;
       multi_log_state *mls = ap_get_module_config(cmd->server->module_config,
                                                &config_log_module);
   
  @@ -833,14 +861,8 @@
           }
       }
       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);
  +        mls->default_format_string = fmt;
  +        mls->default_format = parse_log_string(cmd->pool, fmt, &err_string);
       }
       return err_string;
   }
  @@ -852,17 +874,15 @@
       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;
  +    cls->format_string = fmt;
       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->format = parse_log_string(cmd->pool, fmt, &err_string);
       }
       cls->log_fd = -1;
   
  
  
  

Mime
View raw message