httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r408729 - /httpd/httpd/trunk/modules/cache/cache_storage.c
Date Mon, 22 May 2006 19:05:09 GMT
Author: rpluem
Date: Mon May 22 12:05:09 2006
New Revision: 408729

URL: http://svn.apache.org/viewvc?rev=408729&view=rev
Log:
* Cleanup the code by replacing some inline code to lower-case a string with
  ap_str_tolower.

Proposed by: Joe Orton

Modified:
    httpd/httpd/trunk/modules/cache/cache_storage.c

Modified: httpd/httpd/trunk/modules/cache/cache_storage.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_storage.c?rev=408729&r1=408728&r2=408729&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_storage.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_storage.c Mon May 22 12:05:09 2006
@@ -351,10 +351,8 @@
     }
     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 @@
      */
     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;
     }



Mime
View raw message