summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Jaillet <jailletc36@apache.org>2012-10-16 22:07:30 +0200
committerChristophe Jaillet <jailletc36@apache.org>2012-10-16 22:07:30 +0200
commit1948bf5f9a1b7213dfb8c8dec02b60859ffb335a (patch)
treeb708fe6744d70448ff94b11cf99a817ddcccc7ff
parentcppCheck: unreadVariable - 'serviceFlag' is not used in the function, so remo... (diff)
downloadapache2-1948bf5f9a1b7213dfb8c8dec02b60859ffb335a.tar.xz
apache2-1948bf5f9a1b7213dfb8c8dec02b60859ffb335a.zip
Use 'ap_strcasestr' instead of a strdup/str_tolower/strstr sequence
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1398970 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/filters/mod_filter.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c
index 06e4d7a204..2d8e8b6595 100644
--- a/modules/filters/mod_filter.c
+++ b/modules/filters/mod_filter.c
@@ -221,9 +221,7 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter)
const char *str = apr_table_get(r->headers_out,
"Cache-Control");
if (str) {
- char *str1 = apr_pstrdup(r->pool, str);
- ap_str_tolower(str1);
- if (strstr(str1, "no-transform")) {
+ if (ap_strcasestr(str, "no-transform")) {
/* can't use this provider; try next */
continue;
}
@@ -278,7 +276,6 @@ static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb)
apr_status_t ret;
#ifndef NO_PROTOCOL
const char *cachecontrol;
- char *str;
#endif
harness_ctx *ctx = f->ctx;
ap_filter_rec_t *filter = f->frec;
@@ -304,9 +301,7 @@ static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb)
cachecontrol = apr_table_get(f->r->headers_out,
"Cache-Control");
if (cachecontrol) {
- str = apr_pstrdup(f->r->pool, cachecontrol);
- ap_str_tolower(str);
- if (strstr(str, "no-transform")) {
+ if (ap_strcasestr(cachecontrol, "no-transform")) {
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}