summaryrefslogtreecommitdiffstatsabout
path: root/utility/logparse.c
diff options
context:
space:
mode:
authorEdward Rudd <urkle@outoforder.cc>2008-10-28 23:43:50 (GMT)
committer Edward Rudd <urkle@outoforder.cc>2008-10-28 23:43:50 (GMT)
commitd3a4a623fa6e429bfa5938e01c97cb7dbd3ece97 (patch)
treee572ba163687da9957d234317866a579e419cb0a /utility/logparse.c
parenta6ebd05abf74aa4b860141c1728ab4364dbc6c01 (diff)
added optional 2nd argument for "queryarg" parameter that is the list of seperators
Diffstat (limited to 'utility/logparse.c')
-rw-r--r--utility/logparse.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/utility/logparse.c b/utility/logparse.c
index 7c52ff6..a1dce69 100644
--- a/utility/logparse.c
+++ b/utility/logparse.c
@@ -117,6 +117,7 @@ static apr_status_t parser_func_queryarg(apr_pool_t *p, config_t *cfg,
117 if (query_beg) { 117 if (query_beg) {
118 char *key; 118 char *key;
119 char *value; 119 char *value;
120 const char *delim = "&";
120 char *query_string; 121 char *query_string;
121 char *strtok_state; 122 char *strtok_state;
122 char *query_end = strrchr(++query_beg,' '); 123 char *query_end = strrchr(++query_beg,' ');
@@ -124,8 +125,10 @@ static apr_status_t parser_func_queryarg(apr_pool_t *p, config_t *cfg,
124 query_string = apr_pstrndup(p, query_beg, query_end-query_beg); 125 query_string = apr_pstrndup(p, query_beg, query_end-query_beg);
125 logging_log(cfg, LOGLEVEL_DEBUG, "QUERY: Found String %pp, %pp, %s", 126 logging_log(cfg, LOGLEVEL_DEBUG, "QUERY: Found String %pp, %pp, %s",
126 query_beg, query_end, query_string); 127 query_beg, query_end, query_string);
127 128 if (field->args[1]) {
128 key = apr_strtok(query_string, "&", &strtok_state); 129 delim = field->args[1];
130 }
131 key = apr_strtok(query_string, delim, &strtok_state);
129 while (key) { 132 while (key) {
130 value = strchr(key, '='); 133 value = strchr(key, '=');
131 if (value) { 134 if (value) {
@@ -142,7 +145,7 @@ static apr_status_t parser_func_queryarg(apr_pool_t *p, config_t *cfg,
142 logging_log(cfg, LOGLEVEL_DEBUG, 145 logging_log(cfg, LOGLEVEL_DEBUG,
143 "QUERY: Found arg: %s = %s", key, value); 146 "QUERY: Found arg: %s = %s", key, value);
144 147
145 key = apr_strtok(NULL, "&", &strtok_state); 148 key = apr_strtok(NULL, delim, &strtok_state);
146 } 149 }
147 } 150 }
148 parser_set_linedata(field->func,query); 151 parser_set_linedata(field->func,query);