summaryrefslogtreecommitdiffstats
path: root/functions.h
diff options
context:
space:
mode:
Diffstat (limited to 'functions.h')
-rw-r--r--functions.h39
1 files changed, 23 insertions, 16 deletions
diff --git a/functions.h b/functions.h
index dcbc939..917a1f9 100644
--- a/functions.h
+++ b/functions.h
@@ -1,5 +1,4 @@
1/* $Id$ */ 1/* $Header: /home/cvs/mod_log_sql/functions.h,v 1.2 2004/02/05 21:59:46 urkle Exp $ */
2
3/* Begin the individual functions that, given a request r, 2/* Begin the individual functions that, given a request r,
4 * extract the needed information from it and return the 3 * extract the needed information from it and return the
5 * value to the calling entity. 4 * value to the calling entity.
@@ -176,16 +175,20 @@ static const char *extract_specific_cookie(request_rec *r, char *a)
176 char *cookiebuf; 175 char *cookiebuf;
177 176
178 if (a != NULL) { 177 if (a != NULL) {
179 log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, 178 #ifdef DEBUG
180 "watching for cookie '%s'", a); 179 log_error(APLOG_MARK,APLOG_DEBUG,
180 r->server,"watching for cookie '%s'", a);
181 #endif
181 182
182 /* Fetch out the cookie header */ 183 /* Fetch out the cookie header */
183 cookiestr = (char *)apr_table_get(r->headers_in, "cookie2"); 184 cookiestr = (char *)apr_table_get(r->headers_in, "cookie2");
184 if (cookiestr != NULL) { 185 if (cookiestr != NULL) {
185 log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, 186 #ifdef DEBUG
186 "Cookie2: [%s]", cookiestr); 187 log_error(APLOG_MARK,APLOG_DEBUG,r->server,
188 "Cookie2: [%s]", cookiestr);
189 #endif
187 /* Does the cookie string contain one with our name? */ 190 /* Does the cookie string contain one with our name? */
188 isvalid = ap_strstr_c(cookiestr, a); 191 isvalid = strstr(cookiestr, a);
189 if (isvalid != NULL) { 192 if (isvalid != NULL) {
190 /* Move past the cookie name and equal sign */ 193 /* Move past the cookie name and equal sign */
191 isvalid += strlen(a) + 1; 194 isvalid += strlen(a) + 1;
@@ -193,7 +196,7 @@ static const char *extract_specific_cookie(request_rec *r, char *a)
193 cookiebuf = apr_pstrdup(r->pool, isvalid); 196 cookiebuf = apr_pstrdup(r->pool, isvalid);
194 /* Segregate just this cookie out of the string 197 /* Segregate just this cookie out of the string
195 * with a terminating nul at the first semicolon */ 198 * with a terminating nul at the first semicolon */
196 cookieend = ap_strchr(cookiebuf, ';'); 199 cookieend = strchr(cookiebuf, ';');
197 if (cookieend != NULL) 200 if (cookieend != NULL)
198 *cookieend = '\0'; 201 *cookieend = '\0';
199 return cookiebuf; 202 return cookiebuf;
@@ -202,13 +205,15 @@ static const char *extract_specific_cookie(request_rec *r, char *a)
202 205
203 cookiestr = (char *)apr_table_get(r->headers_in, "cookie"); 206 cookiestr = (char *)apr_table_get(r->headers_in, "cookie");
204 if (cookiestr != NULL) { 207 if (cookiestr != NULL) {
205 log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, 208 #ifdef DEBUG
206 "Cookie: [%s]", cookiestr); 209 log_error(APLOG_MARK,APLOG_DEBUG,r->server,
207 isvalid = ap_strstr_c(cookiestr, a); 210 "Cookie: [%s]", cookiestr);
211 #endif
212 isvalid = strstr(cookiestr, a);
208 if (isvalid != NULL) { 213 if (isvalid != NULL) {
209 isvalid += strlen(a) + 1; 214 isvalid += strlen(a) + 1;
210 cookiebuf = apr_pstrdup(r->pool, isvalid); 215 cookiebuf = apr_pstrdup(r->pool, isvalid);
211 cookieend = ap_strchr(cookiebuf, ';'); 216 cookieend = strchr(cookiebuf, ';');
212 if (cookieend != NULL) 217 if (cookieend != NULL)
213 *cookieend = '\0'; 218 *cookieend = '\0';
214 return cookiebuf; 219 return cookiebuf;
@@ -217,13 +222,15 @@ static const char *extract_specific_cookie(request_rec *r, char *a)
217 222
218 cookiestr = apr_table_get(r->headers_out, "set-cookie"); 223 cookiestr = apr_table_get(r->headers_out, "set-cookie");
219 if (cookiestr != NULL) { 224 if (cookiestr != NULL) {
220 log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, 225 #ifdef DEBUG
221 "Set-Cookie: [%s]", cookiestr); 226 log_error(APLOG_MARK,APLOG_DEBUG,r->server,
222 isvalid = ap_strstr_c(cookiestr, a); 227 "Set-Cookie: [%s]", cookiestr);
228 #endif
229 isvalid = strstr(cookiestr, a);
223 if (isvalid != NULL) { 230 if (isvalid != NULL) {
224 isvalid += strlen(a) + 1; 231 isvalid += strlen(a) + 1;
225 cookiebuf = apr_pstrdup(r->pool, isvalid); 232 cookiebuf = apr_pstrdup(r->pool, isvalid);
226 cookieend = ap_strchr(cookiebuf, ';'); 233 cookieend = strchr(cookiebuf, ';');
227 if (cookieend != NULL) 234 if (cookieend != NULL)
228 *cookieend = '\0'; 235 *cookieend = '\0';
229 return cookiebuf; 236 return cookiebuf;