I didn't get any feedback the first time I posted this. Thanks.
---------- Forwarded Message ---------- Subject: [PATCH] log cookie values in 1.3 Date: Thu, 24 Jan 2002 09:41:47 -0500 From: Brian Akins <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] I copied the %C{CookieName} log variable from Apache 2 to 1.3 -- Brian Akins Systems Engineer III CNN Internet Technologies
--- src/modules/standard/mod_log_config.c Mon Jan 15 12:05:44 2001 +++ /home/bakins/src/apache_1.3.22/src/modules/standard/mod_log_config.c Thu Jan 17 08:01:43 2002 /* * multi_log_state is our per-(virtual)-server configuration. We store @@ -482,6 +495,28 @@ static const char *log_connection_status return "-"; } + +static const char *log_cookie(request_rec *r, char *a) +{ + const char *cookies; + const char *start_cookie; + + if ((cookies = ap_table_get(r->headers_in, "Cookie"))) { + if ((start_cookie = strstr(cookies,a))) { + char *cookie, *end_cookie; + start_cookie += strlen(a) + 1; /* cookie_name + '=' */ + cookie = ap_pstrdup(r->pool, start_cookie); + /* kill everything in cookie after ';' */ + end_cookie = strchr(cookie, ';'); + if (end_cookie) { + *end_cookie = '\0'; + } + + return cookie; + } + } + return "-"; +} /***************************************************************** * * Parsing the log format string @@ -567,6 +602,9 @@ static struct log_item_list { }, { 'c', log_connection_status, 0 + }, + { + 'C', log_cookie, 0 }, { '\0'