apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r1232320 - in /apr/apr/trunk: build/ crypto/ include/ include/private/ strmatch/ tables/ test/ uri/ xlate/ xml/
Date Tue, 17 Jan 2012 06:45:04 GMT
Author: bojan
Date: Tue Jan 17 06:45:02 2012
New Revision: 1232320

URL: http://svn.apache.org/viewvc?rev=1232320&view=rev
Log:
Revert hash randomisation for now. Causing regressions in httpd.
It is incomplete and possibly incorrect as well.

Modified:
    apr/apr/trunk/build/apu-conf.m4   (props changed)
    apr/apr/trunk/build/apu-hints.m4   (props changed)
    apr/apr/trunk/build/crypto.m4   (props changed)
    apr/apr/trunk/build/dbd.m4   (props changed)
    apr/apr/trunk/build/dbm.m4   (props changed)
    apr/apr/trunk/build/dso.m4   (props changed)
    apr/apr/trunk/build/iconv.m4   (props changed)
    apr/apr/trunk/crypto/   (props changed)
    apr/apr/trunk/include/apr_anylock.h   (props changed)
    apr/apr/trunk/include/apr_base64.h   (props changed)
    apr/apr/trunk/include/apr_buckets.h   (props changed)
    apr/apr/trunk/include/apr_crypto.h   (props changed)
    apr/apr/trunk/include/apr_date.h   (props changed)
    apr/apr/trunk/include/apr_dbd.h   (props changed)
    apr/apr/trunk/include/apr_dbm.h   (props changed)
    apr/apr/trunk/include/apr_hooks.h   (props changed)
    apr/apr/trunk/include/apr_md4.h   (props changed)
    apr/apr/trunk/include/apr_md5.h   (props changed)
    apr/apr/trunk/include/apr_memcache.h   (props changed)
    apr/apr/trunk/include/apr_optional.h   (props changed)
    apr/apr/trunk/include/apr_optional_hooks.h   (props changed)
    apr/apr/trunk/include/apr_queue.h   (props changed)
    apr/apr/trunk/include/apr_reslist.h   (props changed)
    apr/apr/trunk/include/apr_rmm.h   (props changed)
    apr/apr/trunk/include/apr_sdbm.h   (props changed)
    apr/apr/trunk/include/apr_sha1.h   (props changed)
    apr/apr/trunk/include/apr_strmatch.h   (props changed)
    apr/apr/trunk/include/apr_thread_pool.h   (props changed)
    apr/apr/trunk/include/apr_uri.h   (props changed)
    apr/apr/trunk/include/apr_uuid.h   (props changed)
    apr/apr/trunk/include/apr_xlate.h   (props changed)
    apr/apr/trunk/include/apr_xml.h   (props changed)
    apr/apr/trunk/include/apu_errno.h   (props changed)
    apr/apr/trunk/include/apu_version.h   (props changed)
    apr/apr/trunk/include/apu_want.h.in   (props changed)
    apr/apr/trunk/include/apu_want.hnw   (props changed)
    apr/apr/trunk/include/apu_want.hw   (props changed)
    apr/apr/trunk/include/private/   (props changed)
    apr/apr/trunk/strmatch/   (props changed)
    apr/apr/trunk/tables/apr_hash.c
    apr/apr/trunk/test/NWGNUaprtest   (props changed)
    apr/apr/trunk/test/NWGNUglobalmutexchild   (props changed)
    apr/apr/trunk/test/NWGNUmod_test   (props changed)
    apr/apr/trunk/test/NWGNUproc_child   (props changed)
    apr/apr/trunk/test/NWGNUreadchild   (props changed)
    apr/apr/trunk/test/NWGNUsockchild   (props changed)
    apr/apr/trunk/test/NWGNUtestatmc   (props changed)
    apr/apr/trunk/test/NWGNUtryread   (props changed)
    apr/apr/trunk/test/testbuckets.c   (props changed)
    apr/apr/trunk/test/testcrypto.c   (props changed)
    apr/apr/trunk/test/testdate.c   (props changed)
    apr/apr/trunk/test/testdbd.c   (props changed)
    apr/apr/trunk/test/testdbm.c   (props changed)
    apr/apr/trunk/test/testmd4.c   (props changed)
    apr/apr/trunk/test/testmd5.c   (props changed)
    apr/apr/trunk/test/testmemcache.c   (props changed)
    apr/apr/trunk/test/testpass.c   (props changed)
    apr/apr/trunk/test/testqueue.c   (props changed)
    apr/apr/trunk/test/testreslist.c   (props changed)
    apr/apr/trunk/test/testrmm.c   (props changed)
    apr/apr/trunk/test/teststrmatch.c   (props changed)
    apr/apr/trunk/test/testuri.c   (props changed)
    apr/apr/trunk/test/testuuid.c   (props changed)
    apr/apr/trunk/test/testxlate.c   (props changed)
    apr/apr/trunk/test/testxml.c   (props changed)
    apr/apr/trunk/uri/   (props changed)
    apr/apr/trunk/xlate/   (props changed)
    apr/apr/trunk/xml/   (props changed)

Propchange: apr/apr/trunk/build/apu-conf.m4
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/build/apu-hints.m4
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/build/crypto.m4
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/build/dbd.m4
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/build/dbm.m4
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/build/dso.m4
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/build/iconv.m4
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/crypto/
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_anylock.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_base64.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_buckets.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_crypto.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_date.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_dbd.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_dbm.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_hooks.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_md4.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_md5.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_memcache.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_optional.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_optional_hooks.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_queue.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_reslist.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_rmm.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_sdbm.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_sha1.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_strmatch.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_thread_pool.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_uri.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_uuid.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_xlate.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apr_xml.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apu_errno.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apu_version.h
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apu_want.h.in
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apu_want.hnw
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/apu_want.hw
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/include/private/
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/strmatch/
            ('svn:mergeinfo' removed)

Modified: apr/apr/trunk/tables/apr_hash.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/tables/apr_hash.c?rev=1232320&r1=1232319&r2=1232320&view=diff
==============================================================================
--- apr/apr/trunk/tables/apr_hash.c (original)
+++ apr/apr/trunk/tables/apr_hash.c Tue Jan 17 06:45:02 2012
@@ -18,7 +18,6 @@
 
 #include "apr_general.h"
 #include "apr_pools.h"
-#include "apr_time.h"
 
 #include "apr_hash.h"
 
@@ -76,7 +75,7 @@ struct apr_hash_t {
     apr_pool_t          *pool;
     apr_hash_entry_t   **array;
     apr_hash_index_t     iterator;  /* For apr_hash_first(NULL, ...) */
-    unsigned int         count, max, seed;
+    unsigned int         count, max;
     apr_hashfunc_t       hash_func;
     apr_hash_entry_t    *free;  /* List of recycled entries */
 };
@@ -96,18 +95,13 @@ static apr_hash_entry_t **alloc_array(ap
 APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool)
 {
     apr_hash_t *ht;
-    apr_time_t now = apr_time_now();
-
     ht = apr_palloc(pool, sizeof(apr_hash_t));
     ht->pool = pool;
     ht->free = NULL;
     ht->count = 0;
     ht->max = INITIAL_MAX;
-    ht->seed = (unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)pool ^
-                              (apr_uintptr_t)ht ^ (apr_uintptr_t)&now) - 1;
     ht->array = alloc_array(ht, ht->max);
-    ht->hash_func = NULL;
-
+    ht->hash_func = apr_hashfunc_default;
     return ht;
 }
 
@@ -207,10 +201,10 @@ static void expand_array(apr_hash_t *ht)
     ht->max = new_max;
 }
 
-static unsigned int apr_hashfunc_default_internal(const char *char_key,
-                                                  apr_ssize_t *klen,
-                                                  unsigned int hash)
+APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key,
+                                                      apr_ssize_t *klen)
 {
+    unsigned int hash = 0;
     const unsigned char *key = (const unsigned char *)char_key;
     const unsigned char *p;
     apr_ssize_t i;
@@ -252,7 +246,7 @@ static unsigned int apr_hashfunc_default
      *
      *                  -- Ralf S. Engelschall <rse@engelschall.com>
      */
-
+     
     if (*klen == APR_HASH_KEY_STRING) {
         for (p = key; *p; p++) {
             hash = hash * 33 + *p;
@@ -268,11 +262,6 @@ static unsigned int apr_hashfunc_default
     return hash;
 }
 
-APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key,
-                                                      apr_ssize_t *klen)
-{
-    return apr_hashfunc_default_internal(char_key, klen, 0);
-}
 
 /*
  * This is where we keep the details of the hash function and control
@@ -291,10 +280,7 @@ static apr_hash_entry_t **find_entry(apr
     apr_hash_entry_t **hep, *he;
     unsigned int hash;
 
-    if (ht->hash_func)
-        hash = ht->hash_func(key, &klen);
-    else
-        hash = apr_hashfunc_default_internal(key, &klen, ht->seed);
+    hash = ht->hash_func(key, &klen);
 
     /* scan linked list */
     for (hep = &ht->array[hash & ht->max], he = *hep;
@@ -336,7 +322,6 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(
     ht->free = NULL;
     ht->count = orig->count;
     ht->max = orig->max;
-    ht->seed = orig->seed;
     ht->hash_func = orig->hash_func;
     ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t));
 

Propchange: apr/apr/trunk/test/NWGNUaprtest
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/NWGNUglobalmutexchild
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/NWGNUmod_test
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/NWGNUproc_child
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/NWGNUreadchild
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/NWGNUsockchild
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/NWGNUtestatmc
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/NWGNUtryread
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testbuckets.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testcrypto.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testdate.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testdbd.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testdbm.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testmd4.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testmd5.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testmemcache.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testpass.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testqueue.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testreslist.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testrmm.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/teststrmatch.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testuri.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testuuid.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testxlate.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/test/testxml.c
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/uri/
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/xlate/
            ('svn:mergeinfo' removed)

Propchange: apr/apr/trunk/xml/
            ('svn:mergeinfo' removed)



Mime
View raw message