httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_include.c
Date Sat, 23 Aug 2003 03:53:34 GMT
nd          2003/08/22 20:53:34

  Modified:    modules/filters mod_include.c
  Log:
  don't waste memory, if someone configures another error message or
  timeformat during runtime. The common case doesn't need max_string_len
  at all and won't be configured more than one or two times.
  
  Revision  Changes    Path
  1.253     +5 -19     httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.252
  retrieving revision 1.253
  diff -u -r1.252 -r1.253
  --- mod_include.c	23 Aug 2003 03:27:51 -0000	1.252
  +++ mod_include.c	23 Aug 2003 03:53:34 -0000	1.253
  @@ -227,8 +227,6 @@
       arg_item_t   *current_arg;   /* currently parsed argument */
       arg_item_t   *argv;          /* all arguments */
   
  -    char         *error_str_override;
  -    char         *time_str_override;
       char         *re_string;
       regmatch_t   (*re_result)[10];
   };
  @@ -1956,24 +1954,14 @@
           }
   
           if (!strcmp(tag, "errmsg")) {
  -            if (!ctx->intern->error_str_override) {
  -                ctx->intern->error_str_override = apr_palloc(ctx->pool,
  -                                                             MAX_STRING_LEN);
  -                ctx->error_str = ctx->intern->error_str_override;
  -            }
  -
  -            ap_ssi_parse_string(ctx, tag_val, ctx->intern->error_str_override,
  -                                MAX_STRING_LEN, SSI_EXPAND_DROP_NAME);
  +            ctx->error_str = ap_ssi_parse_string(ctx, tag_val, NULL, 0,
  +                                                 SSI_EXPAND_DROP_NAME);
           }
           else if (!strcmp(tag, "timefmt")) {
               apr_time_t date = r->request_time;
  -            if (!ctx->intern->time_str_override) {
  -                ctx->intern->time_str_override = apr_palloc(ctx->pool,
  -                                                            MAX_STRING_LEN);
  -                ctx->time_str = ctx->intern->time_str_override;
  -            }
  -            ap_ssi_parse_string(ctx, tag_val, ctx->intern->time_str_override,
  -                                MAX_STRING_LEN, SSI_EXPAND_DROP_NAME);
  +
  +            ctx->time_str = ap_ssi_parse_string(ctx, tag_val, NULL, 0,
  +                                                SSI_EXPAND_DROP_NAME);
   
               apr_table_setn(env, "DATE_LOCAL", ap_ht_time(r->pool, date, 
                              ctx->time_str, 0));
  @@ -3659,8 +3647,6 @@
   
           ctx->if_nesting_level = 0;
           intern->re_string = NULL;
  -        intern->error_str_override = NULL;
  -        intern->time_str_override = NULL;
   
           ctx->error_str = conf->default_error_msg;
           ctx->time_str = conf->default_time_fmt;
  
  
  

Mime
View raw message