httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r557837 - in /httpd/httpd/trunk: modules/aaa/ modules/cache/ modules/dav/fs/ modules/dav/lock/ modules/filters/ modules/http/ modules/mappers/ modules/ssl/ server/ server/mpm/experimental/event/ server/mpm/worker/ support/
Date Fri, 20 Jul 2007 01:26:56 GMT
Author: niq
Date: Thu Jul 19 18:26:55 2007
New Revision: 557837

URL: http://svn.apache.org/viewvc?view=rev&rev=557837
Log:
Multiple trivial fixes from Christophe JAILLET
PR 38699, 39518, 42005, 42006, 42007, 42008, 42009
The patches are all his, and are sufficiently trivial to review
at a glance.

Modified:
    httpd/httpd/trunk/modules/aaa/mod_authn_core.c
    httpd/httpd/trunk/modules/aaa/mod_authz_core.c
    httpd/httpd/trunk/modules/cache/cache_cache.c
    httpd/httpd/trunk/modules/dav/fs/lock.c
    httpd/httpd/trunk/modules/dav/lock/locks.c
    httpd/httpd/trunk/modules/filters/mod_include.c
    httpd/httpd/trunk/modules/http/mod_mime.c
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c
    httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c
    httpd/httpd/trunk/server/core.c
    httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c
    httpd/httpd/trunk/server/mpm/worker/fdqueue.c
    httpd/httpd/trunk/server/request.c
    httpd/httpd/trunk/server/util.c
    httpd/httpd/trunk/support/htcacheclean.c

Modified: httpd/httpd/trunk/modules/aaa/mod_authn_core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authn_core.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authn_core.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authn_core.c Thu Jul 19 18:26:55 2007
@@ -88,8 +88,7 @@
     /* Create this conf by duplicating the base, replacing elements
     * (or creating copies for merging) where new-> values exist.
     */
-    conf = (authn_core_dir_conf *)apr_palloc(a, sizeof(authn_core_dir_conf));
-    memcpy(conf, base, sizeof(authn_core_dir_conf));
+    conf = (authn_core_dir_conf *)apr_pmemdup(a, base, sizeof(authn_core_dir_conf));
 
     if (new->ap_auth_type) {
         conf->ap_auth_type = new->ap_auth_type;

Modified: httpd/httpd/trunk/modules/aaa/mod_authz_core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authz_core.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authz_core.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authz_core.c Thu Jul 19 18:26:55 2007
@@ -132,8 +132,7 @@
     /* Create this conf by duplicating the base, replacing elements
     * (or creating copies for merging) where new-> values exist.
     */
-    conf = (authz_core_dir_conf *)apr_palloc(a, sizeof(authz_core_dir_conf));
-    memcpy(conf, base, sizeof(authz_core_dir_conf));
+    conf = (authz_core_dir_conf *)apr_pmemdup(a, new, sizeof(authz_core_dir_conf));
 
     /* Wipe out the providers and rejects lists so that 
         they can be recreated by the merge process. */

Modified: httpd/httpd/trunk/modules/cache/cache_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_cache.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_cache.c Thu Jul 19 18:26:55 2007
@@ -85,13 +85,7 @@
 
 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)

Modified: httpd/httpd/trunk/modules/dav/fs/lock.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/fs/lock.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/dav/fs/lock.c (original)
+++ httpd/httpd/trunk/modules/dav/fs/lock.c Thu Jul 19 18:26:55 2007
@@ -600,8 +600,7 @@
             dp = apr_pcalloc(p, sizeof(*dp));
             memcpy(dp, val.dptr + offset, sizeof(dp->f));
             offset += sizeof(dp->f);
-            dp->locktoken = apr_palloc(p, sizeof(*dp->locktoken));
-            memcpy(dp->locktoken, val.dptr + offset, sizeof(*dp->locktoken));
+            dp->locktoken = apr_pmemdup(p, val.dptr + offset, sizeof(*dp->locktoken));
             offset += sizeof(*dp->locktoken);
             if (*(val.dptr + offset) == '\0') {
                 ++offset;
@@ -648,15 +647,13 @@
             /* Create and fill a dav_lock_indirect structure */
 
             ip = apr_pcalloc(p, sizeof(*ip));
-            ip->locktoken = apr_palloc(p, sizeof(*ip->locktoken));
-            memcpy(ip->locktoken, val.dptr + offset, sizeof(*ip->locktoken));
+            ip->locktoken = apr_pmemdup(p, val.dptr + offset, sizeof(*ip->locktoken));
             offset += sizeof(*ip->locktoken);
             memcpy(&ip->timeout, val.dptr + offset, sizeof(ip->timeout));
             offset += sizeof(ip->timeout);
             memcpy(&ip->key.dsize, val.dptr + offset, sizeof(ip->key.dsize)); /*
length of datum */
             offset += sizeof(ip->key.dsize);
-            ip->key.dptr = apr_palloc(p, ip->key.dsize);
-            memcpy(ip->key.dptr, val.dptr + offset, ip->key.dsize);
+            ip->key.dptr = apr_pmemdup(p, val.dptr + offset, ip->key.dsize);
             offset += ip->key.dsize;
 
             if (!dav_fs_lock_expired(ip->timeout)) {

Modified: httpd/httpd/trunk/modules/dav/lock/locks.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/lock/locks.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/dav/lock/locks.c (original)
+++ httpd/httpd/trunk/modules/dav/lock/locks.c Thu Jul 19 18:26:55 2007
@@ -603,8 +603,7 @@
             offset += sizeof(dp->f);
 
             /* Copy the lock token. */
-            dp->locktoken = apr_palloc(p, sizeof(*dp->locktoken));
-            memcpy(dp->locktoken, val.dptr + offset, sizeof(*dp->locktoken));
+            dp->locktoken = apr_pmemdup(p, val.dptr + offset, sizeof(*dp->locktoken));
             offset += sizeof(*dp->locktoken);
 
             /* Do we have an owner field? */
@@ -639,16 +638,14 @@
             /* Create and fill a dav_lock_indirect structure */
 
             ip = apr_pcalloc(p, sizeof(*ip));
-            ip->locktoken = apr_palloc(p, sizeof(*ip->locktoken));
-            memcpy(ip->locktoken, val.dptr + offset, sizeof(*ip->locktoken));
+            ip->locktoken = apr_pmemdup(p, val.dptr + offset, sizeof(*ip->locktoken));
             offset += sizeof(*ip->locktoken);
             memcpy(&ip->timeout, val.dptr + offset, sizeof(ip->timeout));
             offset += sizeof(ip->timeout);
             /* length of datum */
             ip->key.dsize = *((int *) (val.dptr + offset));
             offset += sizeof(ip->key.dsize);
-            ip->key.dptr = apr_palloc(p, ip->key.dsize);
-            memcpy(ip->key.dptr, val.dptr + offset, ip->key.dsize);
+            ip->key.dptr = apr_pmemdup(p, val.dptr + offset, ip->key.dsize);
             offset += ip->key.dsize;
 
             if (!dav_generic_lock_expired(ip->timeout)) {

Modified: httpd/httpd/trunk/modules/filters/mod_include.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_include.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_include.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_include.c Thu Jul 19 18:26:55 2007
@@ -3225,9 +3225,8 @@
 
             /* check if we mismatched earlier and have to release some chars */
             if (release && (ctx->flags & SSI_FLAG_PRINTING)) {
-                char *to_release = apr_palloc(ctx->pool, release);
+                char *to_release = apr_pmemdup(ctx->pool, intern->start_seq, release);
 
-                memcpy(to_release, intern->start_seq, release);
                 newb = apr_bucket_pool_create(to_release, release, ctx->pool,
                                               f->c->bucket_alloc);
                 APR_BRIGADE_INSERT_TAIL(pass_bb, newb);
@@ -3414,9 +3413,9 @@
     if (intern->seen_eos) {
         if (PARSE_HEAD == intern->state) {
             if (ctx->flags & SSI_FLAG_PRINTING) {
-                char *to_release = apr_palloc(ctx->pool, intern->parse_pos);
+                char *to_release = apr_pmemdup(ctx->pool, intern->start_seq,
+                                                          intern->parse_pos);
 
-                memcpy(to_release, intern->start_seq, intern->parse_pos);
                 APR_BRIGADE_INSERT_TAIL(pass_bb,
                                         apr_bucket_pool_create(to_release,
                                         intern->parse_pos, ctx->pool,

Modified: httpd/httpd/trunk/modules/http/mod_mime.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/mod_mime.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/http/mod_mime.c (original)
+++ httpd/httpd/trunk/modules/http/mod_mime.c Thu Jul 19 18:26:55 2007
@@ -140,11 +140,10 @@
                                         const void *base_val,
                                         const void *data)
 {
-    extension_info *new_info = apr_palloc(p, sizeof(extension_info));
     const extension_info *overlay_info = (const extension_info *)overlay_val;
     const extension_info *base_info = (const extension_info *)base_val;
+    extension_info *new_info = apr_pmemdup(p, base_info, sizeof(extension_info));
 
-    memcpy(new_info, base_info, sizeof(extension_info));
     if (overlay_info->forced_type) {
         new_info->forced_type = overlay_info->forced_type;
     }

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Thu Jul 19 18:26:55 2007
@@ -1072,11 +1072,7 @@
 
 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;
 }

Modified: httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c Thu Jul 19 18:26:55 2007
@@ -374,8 +374,7 @@
                     bDelete = TRUE;
             }
             if (bDelete) {
-                if ((keylist[keyidx].dptr = apr_palloc(p, dbmkey.dsize)) != NULL) {
-                    memcpy(keylist[keyidx].dptr, dbmkey.dptr, dbmkey.dsize);
+                if ((keylist[keyidx].dptr = apr_pmemdup(p, dbmkey.dptr, dbmkey.dsize)) !=
NULL) {
                     keylist[keyidx].dsize = dbmkey.dsize;
                     keyidx++;
                     if (keyidx == KEYMAX)

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Thu Jul 19 18:26:55 2007
@@ -223,8 +223,7 @@
     /* Create this conf by duplicating the base, replacing elements
      * (or creating copies for merging) where new-> values exist.
      */
-    conf = (core_dir_config *)apr_palloc(a, sizeof(core_dir_config));
-    memcpy(conf, base, sizeof(core_dir_config));
+    conf = (core_dir_config *)apr_pmemdup(a, base, sizeof(core_dir_config));
 
     conf->d = new->d;
     conf->d_is_fnmatch = new->d_is_fnmatch;
@@ -270,10 +269,9 @@
     else if (new->response_code_strings != NULL) {
         /* If we merge, the merge-result must have it's own array
          */
-        conf->response_code_strings = apr_palloc(a,
+        conf->response_code_strings = apr_pmemdup(a,
+            base->response_code_strings,
             sizeof(*conf->response_code_strings) * RESPONSE_CODES);
-        memcpy(conf->response_code_strings, base->response_code_strings,
-               sizeof(*conf->response_code_strings) * RESPONSE_CODES);
 
         for (i = 0; i < RESPONSE_CODES; ++i) {
             if (new->response_code_strings[i] != NULL) {
@@ -471,8 +469,7 @@
     core_server_config *virt = (core_server_config *)virtv;
     core_server_config *conf;
 
-    conf = (core_server_config *)apr_palloc(p, sizeof(core_server_config));
-    memcpy(conf, virt, sizeof(core_server_config));
+    conf = (core_server_config *)apr_pmemdup(p, virt, sizeof(core_server_config));
 
     if (!conf->access_name) {
         conf->access_name = base->access_name;

Modified: httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c (original)
+++ httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c Thu Jul 19 18:26:55 2007
@@ -65,8 +65,7 @@
     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);

Modified: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/fdqueue.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/fdqueue.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/fdqueue.c Thu Jul 19 18:26:55 2007
@@ -58,8 +58,7 @@
     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);

Modified: httpd/httpd/trunk/server/request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/request.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/server/request.c (original)
+++ httpd/httpd/trunk/server/request.c Thu Jul 19 18:26:55 2007
@@ -1764,9 +1764,9 @@
         /* 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, "/");
         }
     }
 

Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Thu Jul 19 18:26:55 2007
@@ -2074,10 +2074,9 @@
     if (semi) {
         *semi = '\0';
     }
-    while (*str) {
-        *str = apr_tolower(*str);
-        ++str;
-    }
+
+    ap_str_tolower(*str);
+
     if (semi) {
         *semi = ';';
     }

Modified: httpd/httpd/trunk/support/htcacheclean.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/htcacheclean.c?view=diff&rev=557837&r1=557836&r2=557837
==============================================================================
--- httpd/httpd/trunk/support/htcacheclean.c (original)
+++ httpd/httpd/trunk/support/htcacheclean.c Thu Jul 19 18:26:55 2007
@@ -474,9 +474,7 @@
                             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 {



Mime
View raw message