[mod-xhtml-neg-cvs] mod_xhtml_neg-2.0 Doxyfile,1.2,1.3 Makefile,1.2,1.3 mod_xhtml_neg.c,1.14,1.15
Brought to you by:
run2000
From: <ru...@us...> - 2004-03-30 10:48:53
|
Update of /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30437 Modified Files: Doxyfile Makefile mod_xhtml_neg.c Log Message: Use a better hashing algorithm for generating ETag suffix. Index: Doxyfile =================================================================== RCS file: /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0/Doxyfile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Doxyfile 25 Mar 2004 10:20:54 -0000 1.2 --- Doxyfile 30 Mar 2004 10:37:04 -0000 1.3 *************** *** 24,28 **** # if some version control system is used. ! PROJECT_NUMBER = 0.92 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) --- 24,28 ---- # if some version control system is used. ! PROJECT_NUMBER = 0.93 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) Index: Makefile =================================================================== RCS file: /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 25 Mar 2004 09:40:01 -0000 1.2 --- Makefile 30 Mar 2004 10:37:04 -0000 1.3 *************** *** 4,8 **** build: ! $(APXS) -i -a -c mod_xhtml_neg.c clean: --- 4,8 ---- build: ! $(APXS) -i -a -c mod_xhtml_neg.c lookupa.c clean: Index: mod_xhtml_neg.c =================================================================== RCS file: /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0/mod_xhtml_neg.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mod_xhtml_neg.c 28 Mar 2004 05:56:40 -0000 1.14 --- mod_xhtml_neg.c 30 Mar 2004 10:37:04 -0000 1.15 *************** *** 77,81 **** * @author Nicholas Cull <ru...@us...> * @date 1 March 2004 ! * @version 0.92 * * @history --- 77,81 ---- * @author Nicholas Cull <ru...@us...> * @date 1 March 2004 ! * @version 0.93 * * @history *************** *** 86,89 **** --- 86,90 ---- * 0.9 ETag handled correctly for different content types. \n * 0.92 Pick up the AddDefaultCharset directive from the Apache core \n + * 0.93 Use a better hash function for ETag uniqueness \n * * @directive *************** *** 126,129 **** --- 127,131 ---- #include "http_protocol.h" #include "http_log.h" + #include "lookupa.h" /** Read/write flags used when opening the log file. */ *************** *** 613,623 **** * Make a simple hash code for the given accept_rec structure. This allows * us to generate unique Etags for accepted content-types. The Etag ! * consists of two simple values, the length of the interesting data, ! * and a simple hash of each character. These are then represented as ! * two hyphen separated, zero padded hexadecimal numbers. * * The data that we use to generate the hash is the content-type and charset, * concatenated as one long string. * * @param p a memory pool from which we can allocate temporary memory for this * request --- 615,627 ---- * Make a simple hash code for the given accept_rec structure. This allows * us to generate unique Etags for accepted content-types. The Etag ! * consists of a hash of each character. This is then represented as a ! * zero padded hexadecimal number. * * The data that we use to generate the hash is the content-type and charset, * concatenated as one long string. * + * The hash function is a hash in the public domain by By Bob Jenkins. See + * lookupa.c or http://burtleburtle.net/bob/hash/doobs.html for details. + * * @param p a memory pool from which we can allocate temporary memory for this * request *************** *** 634,650 **** int len, i; ! data = apr_pstrcat( p, rec->name, rec->charset, NULL ); len = mod_xhtml_strlen( data ); ! hash = 7; ! ! /* Note that we use a multiplier of 128 rather than 256 since HTTP ! * headers are only guaranteed 7-bit US-ASCII safe. ! */ ! for( i = 0; i < len; i++ ) { ! hash = hash * 128 + data[ i ]; ! } ! rec->hashcode = apr_psprintf(p, "\"%02x-%08lx\"", ! len, (unsigned long) hash); } --- 638,646 ---- int len, i; ! data = apr_pstrcat( p, rec->name, ";", rec->charset, NULL ); len = mod_xhtml_strlen( data ); ! hash = lookup( data, len, 0 ); ! rec->hashcode = apr_psprintf(p, "\"%08lx\"", (unsigned long) hash); } |