]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Cleanup the code by replacing some inline code to lower-case a string with
authorRuediger Pluem <rpluem@apache.org>
Mon, 22 May 2006 19:05:09 +0000 (19:05 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 22 May 2006 19:05:09 +0000 (19:05 +0000)
  ap_str_tolower.

Proposed by: Joe Orton

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@408729 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/cache_storage.c

index 4d2474eff18983d07ef2579f670db3ca71f1563e..bac7aa21e614965c2783c48a5e78f5aeb5483479 100644 (file)
@@ -351,10 +351,8 @@ apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p,
     }
     else if(r->parsed_uri.hostname) {
         /* Copy the parsed uri hostname */
-        hn = apr_pcalloc(p, strlen(r->parsed_uri.hostname) + 1);
-        for (i = 0; r->parsed_uri.hostname[i]; i++) {
-            hn[i] = apr_tolower(r->parsed_uri.hostname[i]);
-        }
+        hn = apr_pstrdup(p, r->parsed_uri.hostname);
+        ap_str_tolower(hn);
         /* const work-around */
         hostname = hn;
     }
@@ -374,10 +372,8 @@ apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p,
      */
     if (r->proxyreq && r->parsed_uri.scheme) {
         /* Copy the scheme and lower-case it */
-        lcs = apr_pcalloc(p, strlen(r->parsed_uri.scheme) + 1);
-        for (i = 0; r->parsed_uri.scheme[i]; i++) {
-            lcs[i] = apr_tolower(r->parsed_uri.scheme[i]);
-        }
+        lcs = apr_pstrdup(p, r->parsed_uri.scheme);
+        ap_str_tolower(lcs);
         /* const work-around */
         scheme = lcs;
     }