]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport trivial cleanups
authorNick Kew <niq@apache.org>
Wed, 25 Jul 2007 13:13:49 +0000 (13:13 +0000)
committerNick Kew <niq@apache.org>
Wed, 25 Jul 2007 13:13:49 +0000 (13:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@559449 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/cache/cache_cache.c
modules/mappers/mod_rewrite.c
server/mpm/experimental/event/fdqueue.c
server/mpm/worker/fdqueue.c
server/request.c
server/util.c
support/htcacheclean.c

diff --git a/STATUS b/STATUS
index 064d71f103f9d73e68f192f3dcb8564691dba0b0..1b70c165d5a0fdb40d5d35ab86ec5f65c52800a0 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -257,36 +257,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
         http://people.apache.org/~jfclere/patches/ProxyIOBufferSize.1.patch
       +1: jfclere, mturk
 
-    * support/htcacheclean.c:  Trivial cleanups
-      PR: 38699 - Christophe JAILLET
-      http://svn.apache.org/viewvc?view=rev&revision=557837
-      +1: niq, trawick, rpluem
-
-    * mod_cache:       Trivial cleanups
-      PR: 42005 - Christophe JAILLET
-      http://svn.apache.org/viewvc?view=rev&revision=557837
-      +1: niq, trawick, rpluem
-
-    * server/request.c:        Trivial cleanups
-      PR: 42006 - Christophe JAILLET
-      http://svn.apache.org/viewvc?view=rev&revision=557837
-      +1: niq, trawicki, rpluem
-
-    * Worker and Event MPMs: Trivial cleanups
-      PR: 42007 - Christophe JAILLET
-      http://svn.apache.org/viewvc?view=rev&revision=557837
-      +1: niq, trawick, rpluem
-
-    * server/util.c, modules/mappers/mod_rewrite.c: Trivial cleanups
-      PR: 42009 - Christophe JAILLET
-      http://svn.apache.org/viewvc?view=rev&revision=557837
-      +1: niq, trawick
-      -1: rpluem says: This creates a bug. Please add
-          http://svn.apache.org/viewvc?view=rev&rev=558133
-          to the proposal and you have my +1.
-       niq: agrees with rpluem, and points to my post to dev@httpd
-       from this morning.  This trivial cleanup is r557837+r558133.
-
     * multiple files,  Trivial cleanups
       PR: 39518 - Christophe JAILLET
       http://svn.apache.org/viewvc?view=rev&revision=557837
index 6db98f71a66d35d0f1cfa2f41b4fd169f4721d98..860800bb4c999a4dbf06d215f814624d31cd1de7 100644 (file)
@@ -85,13 +85,7 @@ CACHE_DECLARE(void) cache_free(cache_cache_t *c)
 
 CACHE_DECLARE(void*) cache_find(cache_cache_t* c, const char *key)
 {
-    void *e;
-
-    e = cache_hash_get(c->ht, key, CACHE_HASH_KEY_STRING);
-    if (!e)
-        return NULL;
-
-    return e;
+    return cache_hash_get(c->ht, key, CACHE_HASH_KEY_STRING);
 }
 
 CACHE_DECLARE(void) cache_update(cache_cache_t* c, void *entry)
index 6bd5a95f889e78f36db48fa3f3d28d410f6c4288..39dc11fbb6e30d340383da35b9a1d0eeb17a77f0 100644 (file)
@@ -1061,11 +1061,7 @@ static char *rewrite_mapfunc_toupper(request_rec *r, char *key)
 
 static char *rewrite_mapfunc_tolower(request_rec *r, char *key)
 {
-    char *p;
-
-    for (p = key; *p; ++p) {
-        *p = apr_tolower(*p);
-    }
+    ap_str_tolower(key);
 
     return key;
 }
index 51952ced668ed5a6d13badf01e32a77e4f579ddf..c0ef9bbbb1fd9fa2beaa6111d8fcee6d221a13fd 100644 (file)
@@ -65,8 +65,7 @@ apr_status_t ap_queue_info_create(fd_queue_info_t ** queue_info,
     apr_status_t rv;
     fd_queue_info_t *qi;
 
-    qi = apr_palloc(pool, sizeof(*qi));
-    memset(qi, 0, sizeof(*qi));
+    qi = apr_pcalloc(pool, sizeof(*qi));
 
     rv = apr_thread_mutex_create(&qi->idlers_mutex, APR_THREAD_MUTEX_DEFAULT,
                                  pool);
index 6b5485b3a86cda8b6ffb39912f91a4ec2d1b7bfa..8be7c9fa2da5ad63e16f14508e708ac175e443bf 100644 (file)
@@ -58,8 +58,7 @@ apr_status_t ap_queue_info_create(fd_queue_info_t **queue_info,
     apr_status_t rv;
     fd_queue_info_t *qi;
 
-    qi = apr_palloc(pool, sizeof(*qi));
-    memset(qi, 0, sizeof(*qi));
+    qi = apr_pcalloc(pool, sizeof(*qi));
 
     rv = apr_thread_mutex_create(&qi->idlers_mutex, APR_THREAD_MUTEX_DEFAULT,
                                  pool);
index 42696246b1cc433b6f40ca45728301564f040692..92e9154711a4500be455ce0d2b5e03b85f2c7474 100644 (file)
@@ -1742,9 +1742,9 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent,
         /* ap_make_full_path overallocated the buffers
          * by one character to help us out here.
          */
-        strcpy(rnew->filename + strlen(rnew->filename), "/");
+        strcat(rnew->filename, "/");
         if (!rnew->path_info || !*rnew->path_info) {
-            strcpy(rnew->uri  + strlen(rnew->uri ), "/");
+            strcat(rnew->uri, "/");
         }
     }
 
index 55ed076b5f505a0ce60ccf5df756712ebc25e739..e1be3d1831d14da7b3072091457f14e38e8b68e7 100644 (file)
@@ -2074,10 +2074,9 @@ AP_DECLARE(void) ap_content_type_tolower(char *str)
     if (semi) {
         *semi = '\0';
     }
-    while (*str) {
-        *str = apr_tolower(*str);
-        ++str;
-    }
+
+    ap_str_tolower(str);
+
     if (semi) {
         *semi = ';';
     }
index 5a1649dd305cc4e37621dd162e399039d364948c..36a80051f09d403c3b5926d3db87c1296837e6bf 100644 (file)
@@ -473,9 +473,7 @@ static int process_dir(char *path, apr_pool_t *pool)
                             e->dtime = d->dtime;
                             e->hsize = d->hsize;
                             e->dsize = d->dsize;
-                            e->basename = apr_palloc(pool,
-                                                     strlen(d->basename) + 1);
-                            strcpy(e->basename, d->basename);
+                            e->basename = apr_pstrdup(pool, d->basename);
                             break;
                         }
                         else {