Return-Path: Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Delivered-To: mailing list commits@apr.apache.org Received: (qmail 11075 invoked by uid 99); 17 Nov 2004 01:12:23 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,NO_REAL_NAME,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 16 Nov 2004 17:12:22 -0800 Received: (qmail 87073 invoked by uid 65534); 17 Nov 2004 01:12:20 -0000 Date: 17 Nov 2004 01:12:20 -0000 Message-ID: <20041117011220.87070.qmail@minotaur.apache.org> From: thommay@apache.org To: commits@apr.apache.org Subject: svn commit: rev 76075 - in apr/apr-util/branches/1.0.x: . build include ldap misc test uri xlate xml xml/expat X-Virus-Checked: Checked Author: thommay Date: Tue Nov 16 17:12:20 2004 New Revision: 76075 Modified: apr/apr-util/branches/1.0.x/.cvsignore apr/apr-util/branches/1.0.x/CHANGES apr/apr-util/branches/1.0.x/LICENSE apr/apr-util/branches/1.0.x/Makefile.in apr/apr-util/branches/1.0.x/build/apu-iconv.m4 apr/apr-util/branches/1.0.x/build/dbm.m4 apr/apr-util/branches/1.0.x/buildconf apr/apr-util/branches/1.0.x/configure.in apr/apr-util/branches/1.0.x/include/apr_buckets.h apr/apr-util/branches/1.0.x/include/apr_ldap_init.h apr/apr-util/branches/1.0.x/include/apr_md5.h apr/apr-util/branches/1.0.x/include/apr_rmm.h apr/apr-util/branches/1.0.x/include/apu.h.in apr/apr-util/branches/1.0.x/include/apu_version.h apr/apr-util/branches/1.0.x/ldap/apr_ldap_init.c apr/apr-util/branches/1.0.x/ldap/apr_ldap_url.c apr/apr-util/branches/1.0.x/misc/apr_queue.c apr/apr-util/branches/1.0.x/misc/apr_reslist.c apr/apr-util/branches/1.0.x/test/Makefile.win apr/apr-util/branches/1.0.x/test/testrmm.c apr/apr-util/branches/1.0.x/test/testuri.c apr/apr-util/branches/1.0.x/uri/apr_uri.c apr/apr-util/branches/1.0.x/xlate/xlate.c apr/apr-util/branches/1.0.x/xml/apr_xml.c apr/apr-util/branches/1.0.x/xml/expat/buildconf.sh Log: Update 1.0 branch from trunk Modified: apr/apr-util/branches/1.0.x/.cvsignore ============================================================================== --- apr/apr-util/branches/1.0.x/.cvsignore (original) +++ apr/apr-util/branches/1.0.x/.cvsignore Tue Nov 16 17:12:20 2004 @@ -11,9 +11,10 @@ libaprutil*.la aprutil.exp exports.c -export_vars.h +export_vars.[ch] export_vars.sh apu-config +apu-*-config apu-config.out Debug Release @@ -36,4 +37,5 @@ autom4te.cache build-outputs.mk .make.dirs -apr-util.pc +apr-util*.pc +apr-util.spec Modified: apr/apr-util/branches/1.0.x/CHANGES ============================================================================== --- apr/apr-util/branches/1.0.x/CHANGES (original) +++ apr/apr-util/branches/1.0.x/CHANGES Tue Nov 16 17:12:20 2004 @@ -1,3 +1,12 @@ +Changes with APR-util 1.0.1 + + *) Add support for Berkeley DB 4.3. [Jani Averbach ] + + *) SECURITY: CAN-2004-0786 (cve.mitre.org) + Fix input validation in apr_uri_parse() to avoid passing negative + length to memcpy for malformed IPv6 literal addresses. + [Joe Orton] + Changes with APR-util 1.0 *) Only install apu-$MAJOR-config and add appropriate detection code to Modified: apr/apr-util/branches/1.0.x/LICENSE ============================================================================== --- apr/apr-util/branches/1.0.x/LICENSE (original) +++ apr/apr-util/branches/1.0.x/LICENSE Tue Nov 16 17:12:20 2004 @@ -340,69 +340,6 @@ * documentation and/or software. */ - -For the test\testdbm.c component: - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - * This file came from the SDBM package (written by oz@nexus.yorku.ca). - * That package was under public domain. This file has been ported to - * APR, updated to ANSI C and other, newer idioms, and added to the Apache - * codebase under the above copyright and license. - */ - - For the test\testmd4.c component: * Modified: apr/apr-util/branches/1.0.x/Makefile.in ============================================================================== --- apr/apr-util/branches/1.0.x/Makefile.in (original) +++ apr/apr-util/branches/1.0.x/Makefile.in Tue Nov 16 17:12:20 2004 @@ -15,8 +15,8 @@ APRUTIL_LIBS = @APRUTIL_LIBS@ TARGET_LIB = lib@APRUTIL_LIBNAME@.la -INSTALL_SUBDIRS = @APR_XML_DIR@ -EXTRA_SOURCE_DIRS = @APR_XML_DIR@ +INSTALL_SUBDIRS = @APR_ICONV_DIR@ @APR_XML_DIR@ +EXTRA_SOURCE_DIRS = @APR_ICONV_DIR@ @APR_XML_DIR@ EXTRA_OS_LINK=@EXTRA_OS_LINK@ APRUTIL_PCFILE = apr-util-$(APRUTIL_MAJOR_VERSION).pc APU_CONFIG = apu-$(APRUTIL_MAJOR_VERSION)-config @@ -29,7 +29,7 @@ @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ -CLEAN_SUBDIRS = test +CLEAN_SUBDIRS = test @APR_ICONV_DIR@ CLEAN_TARGETS = exports.c export_vars.c aprutil.exp .make.dirs apu-config.out DISTCLEAN_TARGETS = config.cache config.log config.status libtool \ Modified: apr/apr-util/branches/1.0.x/build/apu-iconv.m4 ============================================================================== --- apr/apr-util/branches/1.0.x/build/apu-iconv.m4 (original) +++ apr/apr-util/branches/1.0.x/build/apu-iconv.m4 Tue Nov 16 17:12:20 2004 @@ -22,33 +22,44 @@ AC_DEFUN(APU_FIND_ICONV,[ apu_iconv_dir="unknown" +have_apr_iconv="0" AC_ARG_WITH(iconv,[ --with-iconv[=DIR] path to iconv installation], [ apu_iconv_dir="$withval" if test "$apu_iconv_dir" != "yes"; then APR_ADDTO(CPPFLAGS,[-I$apu_iconv_dir/include]) APR_ADDTO(LDFLAGS,[-L$apu_iconv_dir/lib]) fi + if test -f "$apu_iconv_dir/include/api_version.h"; then + have_apr_iconv="1" + have_iconv="0" + APR_REMOVEFROM(LIBS,[-lapriconv]) + AC_MSG_RESULT("Using apr-iconv") + fi ]) -AC_CHECK_HEADER(iconv.h, [ - APU_TRY_ICONV([ have_iconv="1" ], [ - - APR_ADDTO(LIBS,[-liconv]) - - APU_TRY_ICONV([ - APR_ADDTO(APRUTIL_LIBS,[-liconv]) - APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv]) - have_iconv="1" ], - [ have_iconv="0" ]) +if test "$have_apr_iconv" != "1"; then + AC_CHECK_HEADER(iconv.h, [ + APU_TRY_ICONV([ have_iconv="1" ], [ + + APR_ADDTO(LIBS,[-liconv]) + + APU_TRY_ICONV([ + APR_ADDTO(APRUTIL_LIBS,[-liconv]) + APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv]) + have_iconv="1" ], + [ have_iconv="0" ]) - APR_REMOVEFROM(LIBS,[-liconv]) + APR_REMOVEFROM(LIBS,[-liconv]) - ]) -], [ have_iconv="0" ]) + ]) + ], [ have_iconv="0" ]) +fi if test "$apu_iconv_dir" != "unknown"; then if test "$have_iconv" != "1"; then - AC_MSG_ERROR([iconv support requested, but not found]) + if test "$have_apr_iconv" != "1"; then + AC_MSG_ERROR([iconv support requested, but not found]) + fi fi APR_REMOVEFROM(CPPFLAGS,[-I$apu_iconv_dir/include]) APR_REMOVEFROM(LDFLAGS,[-L$apu_iconv_dir/lib]) @@ -65,6 +76,7 @@ APR_CHECK_DEFINE(CODESET, langinfo.h, [CODESET defined in langinfo.h]) AC_SUBST(have_iconv) +AC_SUBST(have_apr_iconv) ])dnl dnl Modified: apr/apr-util/branches/1.0.x/build/dbm.m4 ============================================================================== --- apr/apr-util/branches/1.0.x/build/dbm.m4 (original) +++ apr/apr-util/branches/1.0.x/build/dbm.m4 Tue Nov 16 17:12:20 2004 @@ -410,6 +410,25 @@ apu_db_version=4 fi ]) +dnl +dnl APU_CHECK_DB43: is DB4.3 present? +dnl +dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version +dnl +AC_DEFUN(APU_CHECK_DB43, [ + places=$1 + if test -z "$places"; then + places="std /usr/local/BerkeleyDB.4.3 /boot/home/config" + fi + APU_CHECK_BERKELEY_DB("4", "3", "-1", + "$places", + "db43/db.h db4/db.h db.h", + "db-4.3 db43 db4 db" + ) + if test "$apu_have_db" = "1"; then + apu_db_version=4 + fi +]) AC_DEFUN(APU_CHECK_DB, [ @@ -465,6 +484,12 @@ AC_MSG_ERROR(Berkeley db4 not found) fi ;; + db43) + APU_CHECK_DB43("$check_places") + if test "$apu_db_version" != "4"; then + AC_MSG_ERROR(Berkeley db4 not found) + fi + ;; default) APU_CHECK_DB_ALL("$check_places") ;; @@ -472,24 +497,27 @@ ]) dnl -dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 4.2 to 1. +dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 4.3 to 1. dnl AC_DEFUN(APU_CHECK_DB_ALL, [ all_places=$1 - APU_CHECK_DB42("$all_places") + APU_CHECK_DB43("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB41("$all_places") + APU_CHECK_DB42("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB4("$all_places") + APU_CHECK_DB41("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB3("$all_places") - if test "$apu_db_version" != "3"; then - APU_CHECK_DB2("$all_places") - if test "$apu_db_version" != "2"; then - APU_CHECK_DB1("$all_places") - if test "$apu_db_version" != "1"; then - APU_CHECK_DB185("$all_places") + APU_CHECK_DB4("$all_places") + if test "$apu_db_version" != "4"; then + APU_CHECK_DB3("$all_places") + if test "$apu_db_version" != "3"; then + APU_CHECK_DB2("$all_places") + if test "$apu_db_version" != "2"; then + APU_CHECK_DB1("$all_places") + if test "$apu_db_version" != "1"; then + APU_CHECK_DB185("$all_places") + fi fi fi fi @@ -524,11 +552,11 @@ AC_ARG_WITH(dbm, [ --with-dbm=DBM choose the DBM type to use. - DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42} + DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43} ], [ if test "$withval" = "yes"; then AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use. - One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42]) + One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43]) fi requested="$withval" ], [ @@ -703,6 +731,10 @@ apu_default_dbm=db4 ;; db42) + apu_use_db=1 + apu_default_dbm=db4 + ;; + db43) apu_use_db=1 apu_default_dbm=db4 ;; Modified: apr/apr-util/branches/1.0.x/buildconf ============================================================================== --- apr/apr-util/branches/1.0.x/buildconf (original) +++ apr/apr-util/branches/1.0.x/buildconf Tue Nov 16 17:12:20 2004 @@ -1,4 +1,20 @@ #!/bin/sh +# +# Copyright 1999-2004 The Apache Software Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# # Default place to look for apr source. Can be overridden with # --with-apr=[directory] @@ -63,6 +79,14 @@ # echo "Generating 'make' outputs ..." $apr_src_dir/build/gen-build.py make + +# +# If apr-iconv, then go and configure it. +# +if test -d ../apr-iconv; then + echo "Invoking ../apr-iconv/buildconf.sh ..." + (cd ../apr-iconv; ./buildconf) +fi # # If Expat has been bundled, then go and configure the thing Modified: apr/apr-util/branches/1.0.x/configure.in ============================================================================== --- apr/apr-util/branches/1.0.x/configure.in (original) +++ apr/apr-util/branches/1.0.x/configure.in Tue Nov 16 17:12:20 2004 @@ -96,6 +96,21 @@ APR_ADDTO(CFLAGS, `$apr_config --cflags`) APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`) +dnl +dnl Find the APR-ICONV directory. +dnl +if test -d ../apr-iconv; then + APR_SUBDIR_CONFIG(../apr-iconv, + [$apache_apr_flags --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir], + [--enable-layout=*|\'--enable-layout=*]) + APRUTIL_EXPORT_LIBS="$abs_srcdir/../apr-iconv/lib/libapriconv.la $APRUTIL_EXPORT_LIBS" + APRUTIL_INCLUDES="-I$abs_srcdir/../apr-iconv/include $APRUTIL_INCLUDES" + APR_ICONV_DIR=../apr-iconv +else + APR_ICONV_DIR="" +fi +AC_SUBST(APR_ICONV_DIR) + dnl Find LDAP library dnl Determine what DBM backend type to use. dnl Find Expat @@ -187,7 +202,7 @@ AC_SUBST(INCLUDE_RULES) AC_SUBST(INCLUDE_OUTPUTS) -if test -d ./test; then +if test -d $srcdir/test; then test_Makefile="test/Makefile" fi Modified: apr/apr-util/branches/1.0.x/include/apr_buckets.h ============================================================================== --- apr/apr-util/branches/1.0.x/include/apr_buckets.h (original) +++ apr/apr-util/branches/1.0.x/include/apr_buckets.h Tue Nov 16 17:12:20 2004 @@ -701,17 +701,6 @@ apr_off_t point, apr_bucket **after_point); -#if APR_NOT_DONE_YET -/** - * consume nbytes from beginning of b -- call apr_bucket_destroy as - * appropriate, and/or modify start on last element - * @param b The brigade to consume data from - * @param nbytes The number of bytes to consume - */ -APU_DECLARE(void) apr_brigade_consume(apr_bucket_brigade *b, - apr_off_t nbytes); -#endif - /** * Return the total length of the brigade. * @param bb The brigade to compute the length of Modified: apr/apr-util/branches/1.0.x/include/apr_ldap_init.h ============================================================================== --- apr/apr-util/branches/1.0.x/include/apr_ldap_init.h (original) +++ apr/apr-util/branches/1.0.x/include/apr_ldap_init.h Tue Nov 16 17:12:20 2004 @@ -34,7 +34,7 @@ int cert_file_type, apr_ldap_err_t **result_err); -APU_DECLARE(int) apr_ldap_ssl_deinit(); +APU_DECLARE(int) apr_ldap_ssl_deinit(void); APU_DECLARE(int) apr_ldap_init(apr_pool_t *pool, LDAP **ldap, Modified: apr/apr-util/branches/1.0.x/include/apr_md5.h ============================================================================== --- apr/apr-util/branches/1.0.x/include/apr_md5.h (original) +++ apr/apr-util/branches/1.0.x/include/apr_md5.h Tue Nov 16 17:12:20 2004 @@ -133,7 +133,7 @@ * @param password The password to encode * @param salt The salt to use for the encoding * @param result The string to store the encoded password in - * @param nbytes The length of the string + * @param nbytes The size of the result buffer */ APU_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, char *result, apr_size_t nbytes); Modified: apr/apr-util/branches/1.0.x/include/apr_rmm.h ============================================================================== --- apr/apr-util/branches/1.0.x/include/apr_rmm.h (original) +++ apr/apr-util/branches/1.0.x/include/apr_rmm.h Tue Nov 16 17:12:20 2004 @@ -48,6 +48,8 @@ * @param membuf The block of relocateable memory to be managed * @param memsize The size of relocateable memory block to be managed * @param cont The pool to use for local storage and management + * @remark Both @param membuf and @param memsize must be aligned + * (for instance using APR_ALIGN_DEFAULT). */ APU_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, void* membuf, apr_size_t memsize, @@ -108,6 +110,7 @@ * Retrieve the physical address of a relocatable allocation of memory * @param rmm The relocatable memory block * @param entity The memory allocation to free + * @return address The address, aligned with APR_ALIGN_DEFAULT. */ APU_DECLARE(void *) apr_rmm_addr_get(apr_rmm_t *rmm, apr_rmm_off_t entity); Modified: apr/apr-util/branches/1.0.x/include/apu.h.in ============================================================================== --- apr/apr-util/branches/1.0.x/include/apu.h.in (original) +++ apr/apr-util/branches/1.0.x/include/apu.h.in Tue Nov 16 17:12:20 2004 @@ -77,7 +77,7 @@ #define APU_HAVE_DB_VERSION @apu_db_version@ #endif /* APU_HAVE_DB */ -#define APU_HAVE_APR_ICONV 0 +#define APU_HAVE_APR_ICONV @have_apr_iconv@ #define APU_HAVE_ICONV @have_iconv@ #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) Modified: apr/apr-util/branches/1.0.x/include/apu_version.h ============================================================================== --- apr/apr-util/branches/1.0.x/include/apu_version.h (original) +++ apr/apr-util/branches/1.0.x/include/apu_version.h Tue Nov 16 17:12:20 2004 @@ -62,7 +62,14 @@ #define APU_MINOR_VERSION 0 /** patch level */ -#define APU_PATCH_VERSION 0 +#define APU_PATCH_VERSION 1 + +/** + * This symbol is defined for internal, "development" copies of APU. This + * symbol will be #undef'd for releases. + */ +#define APU_IS_DEV_VERSION + /** The formatted string of APU's version */ #define APU_VERSION_STRING \ Modified: apr/apr-util/branches/1.0.x/ldap/apr_ldap_init.c ============================================================================== --- apr/apr-util/branches/1.0.x/ldap/apr_ldap_init.c (original) +++ apr/apr-util/branches/1.0.x/ldap/apr_ldap_init.c Tue Nov 16 17:12:20 2004 @@ -167,7 +167,7 @@ * @todo currently we do not check whether apr_ldap_ssl_init() * has been called first - should we? */ -APU_DECLARE(int) apr_ldap_ssl_deinit() { +APU_DECLARE(int) apr_ldap_ssl_deinit(void) { #if APR_HAS_LDAP_SSL && APR_HAS_NOVELL_LDAPSDK ldapssl_client_deinit(); Modified: apr/apr-util/branches/1.0.x/ldap/apr_ldap_url.c ============================================================================== --- apr/apr-util/branches/1.0.x/ldap/apr_ldap_url.c (original) +++ apr/apr-util/branches/1.0.x/ldap/apr_ldap_url.c Tue Nov 16 17:12:20 2004 @@ -73,6 +73,9 @@ #if APR_HAS_LDAP +#if APR_HAVE_STDLIB_H +#include +#endif #include "apu.h" #include "apr_pools.h" @@ -349,14 +352,13 @@ return APR_EGENERAL; } *r++ = '\0'; - q = strchr( r, ':' ); + q = strrchr( r, ':' ); } else { - q = strchr( url, ':' ); + q = strrchr( url, ':' ); } if ( q != NULL ) { - *q++ = '\0'; - apr_ldap_pvt_hex_unescape( q ); + apr_ldap_pvt_hex_unescape( ++q ); if( *q == '\0' ) { result->reason = "Bad LDAP URL while parsing."; Modified: apr/apr-util/branches/1.0.x/misc/apr_queue.c ============================================================================== --- apr/apr-util/branches/1.0.x/misc/apr_queue.c (original) +++ apr/apr-util/branches/1.0.x/misc/apr_queue.c Tue Nov 16 17:12:20 2004 @@ -309,9 +309,8 @@ /** * Retrieves the next item from the queue. If there are no - * items available, it will block until one becomes available. - * Once retrieved, the item is placed into the address specified by - * 'data'. + * items available, return APR_EAGAIN. Once retrieved, + * the item is placed into the address specified by 'data'. */ APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) { @@ -326,7 +325,6 @@ return rv; } - /* Keep waiting until we wake up and find that the queue is not empty. */ if (apr_queue_empty(queue)) { rv = apr_thread_mutex_unlock(queue->one_big_mutex); return APR_EAGAIN; Modified: apr/apr-util/branches/1.0.x/misc/apr_reslist.c ============================================================================== --- apr/apr-util/branches/1.0.x/misc/apr_reslist.c (original) +++ apr/apr-util/branches/1.0.x/misc/apr_reslist.c Tue Nov 16 17:12:20 2004 @@ -85,17 +85,18 @@ } /** - * Get an empty resource container from the free list. + * Get an resource container from the free list or create a new one. */ static apr_res_t *get_container(apr_reslist_t *reslist) { apr_res_t *res; - assert(!APR_RING_EMPTY(&reslist->free_list, apr_res_t, link)); - - res = APR_RING_FIRST(&reslist->free_list); - APR_RING_REMOVE(res, link); - + if (!APR_RING_EMPTY(&reslist->free_list, apr_res_t, link)) { + res = APR_RING_FIRST(&reslist->free_list); + APR_RING_REMOVE(res, link); + } + else + res = apr_pcalloc(reslist->pool, sizeof(*res)); return res; } @@ -116,7 +117,7 @@ apr_status_t rv; apr_res_t *res; - res = apr_pcalloc(reslist->pool, sizeof(*res)); + res = get_container(reslist); rv = reslist->constructor(&res->opaque, reslist->params, reslist->pool); @@ -215,11 +216,11 @@ res = pop_resource(reslist); reslist->ntotal--; rv = destroy_resource(reslist, res); + free_container(reslist, res); if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(reslist->listlock); return rv; } - free_container(reslist, res); } apr_thread_mutex_unlock(reslist->listlock); Modified: apr/apr-util/branches/1.0.x/test/Makefile.win ============================================================================== --- apr/apr-util/branches/1.0.x/test/Makefile.win (original) +++ apr/apr-util/branches/1.0.x/test/Makefile.win Tue Nov 16 17:12:20 2004 @@ -32,7 +32,7 @@ CFG_CFLAGS = /MD /O2 CFG_DEFINES = /D "NDEBUG" /D "APR_DECLARE_STATIC" \ /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" -CFG_API_LIB = $(API_LIB_PFX)apriconv.lib +CFG_API_LIB = $(API_LIB_PFX)apriconv-1.lib CFG_OUTPUT = LibR !ELSE @@ -62,7 +62,7 @@ CFG_DEFINES = /D "_DEBUG" /D "APR_DECLARE_STATIC" \ /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" CFG_LDFLAGS = /DEBUG -CFG_API_LIB = $(API_LIB_PFX)apriconv.lib +CFG_API_LIB = $(API_LIB_PFX)apriconv-1.lib CFG_OUTPUT = LibD !ELSE @@ -98,8 +98,8 @@ $(SILENT)echo Compiling and linking $@... $(SILENT)cl $(ALL_CFLAGS) /Fo"$*.obj" /Fd"$*" $< \ /link $(ALL_LDFLAGS) /out:$@ \ - "$(APU_LIB_PFX)aprutil.lib" \ - "$(APR_LIB_PFX)apr.lib" \ + "$(APU_LIB_PFX)aprutil-1.lib" \ + "$(APR_LIB_PFX)apr-1.lib" \ "$(CFG_API)" \ kernel32.lib advapi32.lib ws2_32.lib mswsock.lib @@ -117,8 +117,14 @@ ##! $(OUTPUT_DIR)\testxlate.exe \ ##! $(OUTPUT_DIR)\testxml.exe -ALL_TARGETS = $(OUTPUT_DIR)\testxlate.exe - +ALL_TARGETS = $(OUTPUT_DIR)\testxlate.exe \ + $(OUTPUT_DIR)\testdbm.exe \ + $(OUTPUT_DIR)\testqueue.exe \ + $(OUTPUT_DIR)\testrmm.exe \ + $(OUTPUT_DIR)\testmd4.exe \ + $(OUTPUT_DIR)\testmd5.exe \ + $(OUTPUT_DIR)\testxml.exe + all: $(ALL_TARGETS) clean: Modified: apr/apr-util/branches/1.0.x/test/testrmm.c ============================================================================== --- apr/apr-util/branches/1.0.x/test/testrmm.c (original) +++ apr/apr-util/branches/1.0.x/test/testrmm.c Tue Nov 16 17:12:20 2004 @@ -51,7 +51,7 @@ } /* We're going to want 10 blocks of data from our target rmm. */ - size = SHARED_SIZE + apr_rmm_overhead_get(FRAG_COUNT); + size = SHARED_SIZE + apr_rmm_overhead_get(FRAG_COUNT + 1); printf("Creating anonymous shared memory (%" APR_SIZE_T_FMT " bytes).....", size); rv = apr_shm_create(&shm, size, NULL, pool); @@ -87,6 +87,24 @@ else { return APR_EGENERAL; } + + printf("Checking each fragment for address alignment....."); + for (i = 0; i < FRAG_COUNT; i++) { + char *c = apr_rmm_addr_get(rmm, off[i]); + apr_size_t sc = (apr_size_t)c; + + if (off[i] == 0) { + printf("allocation failed for offset %d\n", i); + return APR_ENOMEM; + } + + if (sc & 7) { + printf("Bad alignment for fragment %d; %p not %p!\n", + i, c, (void *)APR_ALIGN_DEFAULT((apr_size_t)c)); + return APR_EGENERAL; + } + } + fprintf(stdout, "OK\n"); printf("Setting each fragment to a unique value.........."); for (i = 0; i < FRAG_COUNT; i++) { Modified: apr/apr-util/branches/1.0.x/test/testuri.c ============================================================================== --- apr/apr-util/branches/1.0.x/test/testuri.c (original) +++ apr/apr-util/branches/1.0.x/test/testuri.c Tue Nov 16 17:12:20 2004 @@ -18,6 +18,7 @@ #include "testutil.h" #include "apr_general.h" +#include "apr_strings.h" #include "apr_uri.h" struct aup_test { @@ -37,6 +38,10 @@ struct aup_test aup_tests[] = { + { "http://[/::1]/index.html", APR_EGENERAL }, + { "http://[", APR_EGENERAL }, + { "http://[?::1]/index.html", APR_EGENERAL }, + { "http://127.0.0.1:9999/asdf.html", 0, "http", "127.0.0.1:9999", NULL, NULL, "127.0.0.1", "9999", "/asdf.html", NULL, NULL, 9999 @@ -166,10 +171,14 @@ const char *s = NULL; for (i = 0; i < sizeof(aup_tests) / sizeof(aup_tests[0]); i++) { + char msg[256]; + memset(&info, 0, sizeof(info)); t = &aup_tests[i]; rv = apr_uri_parse(p, t->uri, &info); - ABTS_INT_EQUAL(tc, rv, t->rv); + apr_snprintf(msg, sizeof msg, "uri '%s': rv=%d not %d", t->uri, + rv, t->rv); + ABTS_ASSERT(tc, msg, rv == t->rv); if (t->rv == APR_SUCCESS) { ABTS_STR_EQUAL(tc, info.scheme, t->scheme); ABTS_STR_EQUAL(tc, info.hostinfo, t->hostinfo); Modified: apr/apr-util/branches/1.0.x/uri/apr_uri.c ============================================================================== --- apr/apr-util/branches/1.0.x/uri/apr_uri.c (original) +++ apr/apr-util/branches/1.0.x/uri/apr_uri.c Tue Nov 16 17:12:20 2004 @@ -357,11 +357,11 @@ if (*hostinfo == '[') { v6_offset1 = 1; v6_offset2 = 2; - s = uri; - do { - --s; - } while (s >= hostinfo && *s != ':' && *s != ']'); - if (s < hostinfo || *s == ']') { + s = memchr(hostinfo, ']', uri - hostinfo); + if (s == NULL) { + return APR_EGENERAL; + } + if (*++s != ':') { s = NULL; /* no port */ } } Modified: apr/apr-util/branches/1.0.x/xlate/xlate.c ============================================================================== --- apr/apr-util/branches/1.0.x/xlate/xlate.c (original) +++ apr/apr-util/branches/1.0.x/xlate/xlate.c Tue Nov 16 17:12:20 2004 @@ -178,8 +178,9 @@ else { /* reset the iconv descriptor, since it's now in an undefined * state. */ - apr_iconv_close(convset->ich); - convset->ich = apr_iconv_open(convset->topage, convset->frompage); + apr_iconv_close(convset->ich, convset->pool); + rv = apr_iconv_open(convset->topage, convset->frompage, + convset->pool, &convset->ich); } } #endif /* APU_HAVE_APR_ICONV */ Modified: apr/apr-util/branches/1.0.x/xml/apr_xml.c ============================================================================== --- apr/apr-util/branches/1.0.x/xml/apr_xml.c (original) +++ apr/apr-util/branches/1.0.x/xml/apr_xml.c Tue Nov 16 17:12:20 2004 @@ -32,15 +32,19 @@ #define DEBUG_CR "\r\n" +static const char APR_KW_xmlns[] = { 0x78, 0x6D, 0x6C, 0x6E, 0x73, '\0' }; +static const char APR_KW_xmlns_lang[] = { 0x78, 0x6D, 0x6C, 0x3A, 0x6C, 0x61, 0x6E, 0x67, '\0' }; +static const char APR_KW_DAV[] = { 0x44, 0x41, 0x56, 0x3A, '\0' }; + /* errors related to namespace processing */ #define APR_XML_NS_ERROR_UNKNOWN_PREFIX (-1000) #define APR_XML_NS_ERROR_INVALID_DECL (-1001) /* test for a namespace prefix that begins with [Xx][Mm][Ll] */ #define APR_XML_NS_IS_RESERVED(name) \ - ( (name[0] == 'X' || name[0] == 'x') && \ - (name[1] == 'M' || name[1] == 'm') && \ - (name[2] == 'L' || name[2] == 'l') ) + ( (name[0] == 0x58 || name[0] == 0x78) && \ + (name[1] == 0x4D || name[1] == 0x6D) && \ + (name[2] == 0x4C || name[2] == 0x6C) ) /* the real (internal) definition of the parser context */ @@ -167,12 +171,12 @@ for (prev = NULL, attr = elem->attr; attr; attr = attr->next) { - if (strncmp(attr->name, "xmlns", 5) == 0) { + if (strncmp(attr->name, APR_KW_xmlns, 5) == 0) { const char *prefix = &attr->name[5]; apr_xml_ns_scope *ns_scope; /* test for xmlns:foo= form and xmlns= form */ - if (*prefix == ':') { + if (*prefix == 0x3A) { /* a namespace prefix declaration must have a non-empty value. */ if (attr->value[0] == '\0') { @@ -206,7 +210,7 @@ /* Note: prev will not be advanced since we just removed "attr" */ } - else if (strcmp(attr->name, "xml:lang") == 0) { + else if (strcmp(attr->name, APR_KW_xmlns_lang) == 0) { /* save away the language (in quoted form) */ elem->lang = apr_xml_quote_string(parser->p, attr->value, 1); @@ -234,7 +238,7 @@ elem->lang = elem->parent->lang; /* adjust the element's namespace */ - colon = strchr(elem_name, ':'); + colon = strchr(elem_name, 0x3A); if (colon == NULL) { /* * The element is using the default namespace, which will always @@ -266,7 +270,7 @@ */ char *attr_name = (char *)attr->name; - colon = strchr(attr_name, ':'); + colon = strchr(attr_name, 0x3A); if (colon == NULL) { /* * Attributes do NOT use the default namespace. Therefore, @@ -348,7 +352,7 @@ parser->doc->namespaces = apr_array_make(pool, 5, sizeof(const char *)); /* ### is there a way to avoid hard-coding this? */ - apr_xml_insert_uri(parser->doc->namespaces, "DAV:"); + apr_xml_insert_uri(parser->doc->namespaces, APR_KW_DAV); parser->xp = XML_ParserCreate(NULL); if (parser->xp == NULL) { Modified: apr/apr-util/branches/1.0.x/xml/expat/buildconf.sh ============================================================================== --- apr/apr-util/branches/1.0.x/xml/expat/buildconf.sh (original) +++ apr/apr-util/branches/1.0.x/xml/expat/buildconf.sh Tue Nov 16 17:12:20 2004 @@ -3,7 +3,7 @@ # # Find libtoolize # -libtoolize=`conftools/PrintPath glibtoolize libtoolize` +libtoolize=`conftools/PrintPath glibtoolize libtoolize libtoolize15 libtoolize14` if [ "x$libtoolize" = "x" ]; then echo "libtoolize not found in path" exit 1