httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: httpd-2.0/modules/metadata mod_usertrack.c
Date Mon, 08 Mar 2004 23:29:11 GMT
jerenkrantz    2004/03/08 15:29:11

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES
               modules/metadata Tag: APACHE_2_0_BRANCH mod_usertrack.c
  Log:
  Fix bug in mod_usertrack when no CookieName is set.
  
  PR: 24483
  Submitted by:	Manni Wood <manniwood planet-save.com>
  Reviewed by:	Cliff Woolley, Justin Erenkrantz, Sander Striker
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.253 +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.252
  retrieving revision 1.988.2.253
  diff -u -u -r1.988.2.252 -r1.988.2.253
  --- CHANGES	8 Mar 2004 23:12:43 -0000	1.988.2.252
  +++ CHANGES	8 Mar 2004 23:29:10 -0000	1.988.2.253
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.49
   
  +  *) Fix bug in mod_usertrack when no CookieName is set.  PR 24483.
  +     [Manni Wood <manniwood planet-save.com>]
  +
     *) Fix some piped log problems: bogus "piped log program '(null)'
        failed" messages during restart and problem with the logger
        respawning again after Apache is stopped.  PR 21648, PR 24805.
  
  
  
  No                   revision
  No                   revision
  1.39.2.9  +21 -10    httpd-2.0/modules/metadata/mod_usertrack.c
  
  Index: mod_usertrack.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_usertrack.c,v
  retrieving revision 1.39.2.8
  retrieving revision 1.39.2.9
  diff -u -u -r1.39.2.8 -r1.39.2.9
  --- mod_usertrack.c	9 Feb 2004 20:53:19 -0000	1.39.2.8
  +++ mod_usertrack.c	8 Mar 2004 23:29:11 -0000	1.39.2.9
  @@ -156,6 +156,20 @@
    * which has three subexpressions, $0..$2 */
   #define NUM_SUBS 3
   
  +static void set_and_comp_regexp(cookie_dir_rec *dcfg, 
  +                                apr_pool_t *p,
  +                                const char *cookie_name) 
  +{
  +    /* The goal is to end up with this regexp, 
  +     * ^cookie_name=([^;]+)|;[\t]+cookie_name=([^;]+) 
  +     * with cookie_name obviously substituted either
  +     * with the real cookie name set by the user in httpd.conf, or with the
  +     * default COOKIE_NAME. */
  +    dcfg->regexp_string = apr_pstrcat(p, "^", cookie_name, "=([^;]+)|;[ \t]+", cookie_name,
"=([^;]+)", NULL);
  +
  +    dcfg->regexp = ap_pregcomp(p, dcfg->regexp_string, REG_EXTENDED);
  +}
  +
   static int spot_cookie(request_rec *r)
   {
       cookie_dir_rec *dcfg = ap_get_module_config(r->per_dir_config,
  @@ -214,6 +228,11 @@
       dcfg->cookie_domain = NULL;
       dcfg->style = CT_UNSET;
       dcfg->enabled = 0;
  +
  +    /* In case the user does not use the CookieName directive,
  +     * we need to compile the regexp for the default cookie name. */
  +    set_and_comp_regexp(dcfg, p, COOKIE_NAME);
  +
       return dcfg;
   }
   
  @@ -299,18 +318,10 @@
   {
       cookie_dir_rec *dcfg = (cookie_dir_rec *) mconfig;
   
  -    /* The goal is to end up with this regexp,
  -     * ^cookie_name=([^;]+)|;[ \t]+cookie_name=([^;]+)
  -     * with cookie_name
  -     * obviously substituted with the real cookie name set by the
  -     * user in httpd.conf. */
  -    dcfg->regexp_string = apr_pstrcat(cmd->pool, "^", name,
  -                                      "=([^;]+)|;[ \t]+", name,
  -                                      "=([^;]+)", NULL);
  -
       dcfg->cookie_name = apr_pstrdup(cmd->pool, name);
   
  -    dcfg->regexp = ap_pregcomp(cmd->pool, dcfg->regexp_string, REG_EXTENDED);
  +    set_and_comp_regexp(dcfg, cmd->pool, name);
  +
       if (dcfg->regexp == NULL) {
           return "Regular expression could not be compiled.";
       }
  
  
  

Mime
View raw message