diff options
author | Edward Rudd | 2004-05-05 21:38:29 +0000 |
---|---|---|
committer | Edward Rudd | 2004-05-05 21:38:29 +0000 |
commit | 0c5c1bb0d0a3efe9ba96784cc5bc58c174db562e (patch) | |
tree | 3b9bb9c9ecf6b72556d65a6cf7b56ccd1760470e | |
parent | d98a5b1a3da9aec6911b28d1104411a942dffb1e (diff) |
changed strstr to ap_strstr or ap_strstr_c
changed strchr to ap_strchr or ap_strchr_c
-rw-r--r-- | apache13.h | 2 | ||||
-rw-r--r-- | functions.h | 12 | ||||
-rw-r--r-- | mod_log_sql.c | 10 |
3 files changed, 13 insertions, 11 deletions
@@ -60,6 +60,8 @@ | |||
60 | #define apr_pstrcat ap_pstrcat | 60 | #define apr_pstrcat ap_pstrcat |
61 | #define apr_psprintf ap_psprintf | 61 | #define apr_psprintf ap_psprintf |
62 | #define apr_snprintf ap_snprintf | 62 | #define apr_snprintf ap_snprintf |
63 | #define ap_strchr strchr | ||
64 | #define ap_strstr strstr | ||
63 | 65 | ||
64 | #define apr_table_set ap_table_set | 66 | #define apr_table_set ap_table_set |
65 | #define apr_table_get ap_table_get | 67 | #define apr_table_get ap_table_get |
diff --git a/functions.h b/functions.h index 7281588..dcbc939 100644 --- a/functions.h +++ b/functions.h | |||
@@ -185,7 +185,7 @@ static const char *extract_specific_cookie(request_rec *r, char *a) | |||
185 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, | 185 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, |
186 | "Cookie2: [%s]", cookiestr); | 186 | "Cookie2: [%s]", cookiestr); |
187 | /* Does the cookie string contain one with our name? */ | 187 | /* Does the cookie string contain one with our name? */ |
188 | isvalid = strstr(cookiestr, a); | 188 | isvalid = ap_strstr_c(cookiestr, a); |
189 | if (isvalid != NULL) { | 189 | if (isvalid != NULL) { |
190 | /* Move past the cookie name and equal sign */ | 190 | /* Move past the cookie name and equal sign */ |
191 | isvalid += strlen(a) + 1; | 191 | isvalid += strlen(a) + 1; |
@@ -193,7 +193,7 @@ static const char *extract_specific_cookie(request_rec *r, char *a) | |||
193 | cookiebuf = apr_pstrdup(r->pool, isvalid); | 193 | cookiebuf = apr_pstrdup(r->pool, isvalid); |
194 | /* Segregate just this cookie out of the string | 194 | /* Segregate just this cookie out of the string |
195 | * with a terminating nul at the first semicolon */ | 195 | * with a terminating nul at the first semicolon */ |
196 | cookieend = strchr(cookiebuf, ';'); | 196 | cookieend = ap_strchr(cookiebuf, ';'); |
197 | if (cookieend != NULL) | 197 | if (cookieend != NULL) |
198 | *cookieend = '\0'; | 198 | *cookieend = '\0'; |
199 | return cookiebuf; | 199 | return cookiebuf; |
@@ -204,11 +204,11 @@ static const char *extract_specific_cookie(request_rec *r, char *a) | |||
204 | if (cookiestr != NULL) { | 204 | if (cookiestr != NULL) { |
205 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, | 205 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, |
206 | "Cookie: [%s]", cookiestr); | 206 | "Cookie: [%s]", cookiestr); |
207 | isvalid = strstr(cookiestr, a); | 207 | isvalid = ap_strstr_c(cookiestr, a); |
208 | if (isvalid != NULL) { | 208 | if (isvalid != NULL) { |
209 | isvalid += strlen(a) + 1; | 209 | isvalid += strlen(a) + 1; |
210 | cookiebuf = apr_pstrdup(r->pool, isvalid); | 210 | cookiebuf = apr_pstrdup(r->pool, isvalid); |
211 | cookieend = strchr(cookiebuf, ';'); | 211 | cookieend = ap_strchr(cookiebuf, ';'); |
212 | if (cookieend != NULL) | 212 | if (cookieend != NULL) |
213 | *cookieend = '\0'; | 213 | *cookieend = '\0'; |
214 | return cookiebuf; | 214 | return cookiebuf; |
@@ -219,11 +219,11 @@ static const char *extract_specific_cookie(request_rec *r, char *a) | |||
219 | if (cookiestr != NULL) { | 219 | if (cookiestr != NULL) { |
220 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, | 220 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, |
221 | "Set-Cookie: [%s]", cookiestr); | 221 | "Set-Cookie: [%s]", cookiestr); |
222 | isvalid = strstr(cookiestr, a); | 222 | isvalid = ap_strstr_c(cookiestr, a); |
223 | if (isvalid != NULL) { | 223 | if (isvalid != NULL) { |
224 | isvalid += strlen(a) + 1; | 224 | isvalid += strlen(a) + 1; |
225 | cookiebuf = apr_pstrdup(r->pool, isvalid); | 225 | cookiebuf = apr_pstrdup(r->pool, isvalid); |
226 | cookieend = strchr(cookiebuf, ';'); | 226 | cookieend = ap_strchr(cookiebuf, ';'); |
227 | if (cookieend != NULL) | 227 | if (cookieend != NULL) |
228 | *cookieend = '\0'; | 228 | *cookieend = '\0'; |
229 | return cookiebuf; | 229 | return cookiebuf; |
diff --git a/mod_log_sql.c b/mod_log_sql.c index 294380b..fc9dcc0 100644 --- a/mod_log_sql.c +++ b/mod_log_sql.c | |||
@@ -128,7 +128,7 @@ LOGSQL_DECLARE(void) log_sql_register_item(server_rec *s, apr_pool_t *p, | |||
128 | char *pos; | 128 | char *pos; |
129 | 129 | ||
130 | if (cfg->transfer_log_format) { | 130 | if (cfg->transfer_log_format) { |
131 | if ( (pos = strchr(cfg->transfer_log_format,key))!=NULL) { | 131 | if ( (pos = ap_strchr_c(cfg->transfer_log_format,key))!=NULL) { |
132 | cfg->parsed_log_format[pos - cfg->transfer_log_format] = item; | 132 | cfg->parsed_log_format[pos - cfg->transfer_log_format] = item; |
133 | } | 133 | } |
134 | } | 134 | } |
@@ -373,7 +373,7 @@ static const char *set_log_sql_info(cmd_parms *cmd, void *dummy, | |||
373 | } | 373 | } |
374 | if (uri.path) { | 374 | if (uri.path) { |
375 | /* extract Database name */ | 375 | /* extract Database name */ |
376 | char *off = strchr(++uri.path,'/'); | 376 | char *off = ap_strchr(++uri.path,'/'); |
377 | if (off) | 377 | if (off) |
378 | *off='\0'; | 378 | *off='\0'; |
379 | set_dbparam(cmd, NULL, "database", uri.path); | 379 | set_dbparam(cmd, NULL, "database", uri.path); |
@@ -850,7 +850,7 @@ static int log_sql_transaction(request_rec *orig) | |||
850 | if ((r->uri) && (cls->transfer_accept_list->nelts)) { | 850 | if ((r->uri) && (cls->transfer_accept_list->nelts)) { |
851 | proceed = 0; | 851 | proceed = 0; |
852 | for (ptrptr = (char **) cls->transfer_accept_list->elts; ptrptr < ptrptr2; ptrptr = (char **) ((char *) ptrptr + cls->transfer_accept_list->elt_size)) | 852 | for (ptrptr = (char **) cls->transfer_accept_list->elts; ptrptr < ptrptr2; ptrptr = (char **) ((char *) ptrptr + cls->transfer_accept_list->elt_size)) |
853 | if (strstr(r->uri, *ptrptr)) { | 853 | if (ap_strstr(r->uri, *ptrptr)) { |
854 | proceed = 1; | 854 | proceed = 1; |
855 | break; | 855 | break; |
856 | } | 856 | } |
@@ -863,7 +863,7 @@ static int log_sql_transaction(request_rec *orig) | |||
863 | ptrptr2 = (char **) (cls->transfer_ignore_list->elts + (cls->transfer_ignore_list->nelts * cls->transfer_ignore_list->elt_size)); | 863 | ptrptr2 = (char **) (cls->transfer_ignore_list->elts + (cls->transfer_ignore_list->nelts * cls->transfer_ignore_list->elt_size)); |
864 | if (r->uri) { | 864 | if (r->uri) { |
865 | for (ptrptr = (char **) cls->transfer_ignore_list->elts; ptrptr < ptrptr2; ptrptr = (char **) ((char *) ptrptr + cls->transfer_ignore_list->elt_size)) | 865 | for (ptrptr = (char **) cls->transfer_ignore_list->elts; ptrptr < ptrptr2; ptrptr = (char **) ((char *) ptrptr + cls->transfer_ignore_list->elt_size)) |
866 | if (strstr(r->uri, *ptrptr)) { | 866 | if (ap_strstr(r->uri, *ptrptr)) { |
867 | return OK; | 867 | return OK; |
868 | } | 868 | } |
869 | } | 869 | } |
@@ -874,7 +874,7 @@ static int log_sql_transaction(request_rec *orig) | |||
874 | thehost = ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME, NULL); | 874 | thehost = ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME, NULL); |
875 | if (thehost) { | 875 | if (thehost) { |
876 | for (ptrptr = (char **) cls->remhost_ignore_list->elts; ptrptr < ptrptr2; ptrptr = (char **) ((char *) ptrptr + cls->remhost_ignore_list->elt_size)) | 876 | for (ptrptr = (char **) cls->remhost_ignore_list->elts; ptrptr < ptrptr2; ptrptr = (char **) ((char *) ptrptr + cls->remhost_ignore_list->elt_size)) |
877 | if (strstr(thehost, *ptrptr)) { | 877 | if (ap_strstr(thehost, *ptrptr)) { |
878 | return OK; | 878 | return OK; |
879 | } | 879 | } |
880 | } | 880 | } |