DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24483>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24483

mod_usertrack dumps core...on apache 2.0.48





------- Additional Comments From [EMAIL PROTECTED]  2003-11-11 05:27 -------
Bojan Smojver, I recommend you use CookieStyle Netscape or CookieStyle Cookie
(or the synonymous CookieStyle 2109) in httpd.conf, not CookieStyle Cookie2 (or
the synonymous CookieStyle RFC2965).

I watched HTTP network traffic through Ethereal, and noted that while Apache
correctly sends "Cookie2:" headers, Mozilla does not accept them. This is why
you see a new cookie each time in your logs: Apache is not finding the cookie
because your browser is not accepting "Cookie2:" headers.

The following is my second try at a patch. It's more elegant than my first
patch. It solves all of the problems (I tested it with or without the CookieName
directive, and with CookieStyle set to Apache, Cookie, and Cookie2 -- though
Mozilla doesn't yet accept Cookie2 headers, so I couldn't test cookie
detection). Like my previous patch, this patch
has not yet been assessed by anyone on the Apache developer's list.

Take the patch that follows, copy it to a file called
mod_usertrack_2.0.48.patch, copy mod_usertrack_2.0.48.patch to
httpd-2.0.48/modules/metadata, then run patch -p0 < mod_usertrack_2.0.48.patch
and recompile.

-Manni

Bojan Smojver, I recommend you use CookieStyle Netscape or CookieStyle Cookie
(or the synonymous CookieStyle 2109) in httpd.conf, not CookieStyle Cookie2 (or
the synonymous CookieStyle RFC2965).

I watched HTTP network traffic through Ethereal, and noted that while Apache
correctly sends "Cookie2:" headers, Mozilla does not accept them. This is why
you see a new cookie each time in your logs: Apache is not finding the cookie
because your browser is not accepting "Cookie2:" headers.

The following is my second try at a patch. It's more elegant than my first
patch. It solves all of the problems (I tested it with or without the CookieName
directive, and with CookieStyle set to Apache, Cookie, and Cookie2 -- though
Mozilla doesn't yet accept Cookie2 headers, so I couldn't test cookie
detection). Like my previous patch, this patch
has not yet been assessed by anyone on the Apache developer's list.

Take the patch that follows, copy it to a file called
mod_usertrack_2.0.48.patch, copy mod_usertrack_2.0.48.patch to
httpd-2.0.48/modules/metadata, then run patch -p0 < mod_usertrack_2.0.48.patch
and recompile.

-Manni

--- mod_usertrack-old.c 2003-11-10 23:28:19.000000000 -0500
+++ mod_usertrack.c     2003-11-11 00:16:15.000000000 -0500
@@ -199,6 +199,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,
@@ -260,6 +274,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;
 }
 
@@ -345,18 +364,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.";
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to