From commits-return-12488-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Sun Apr 1 12:07:55 2012 Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B234F9952 for ; Sun, 1 Apr 2012 12:07:55 +0000 (UTC) Received: (qmail 50223 invoked by uid 500); 1 Apr 2012 12:07:55 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 50187 invoked by uid 500); 1 Apr 2012 12:07:55 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 50171 invoked by uid 99); 1 Apr 2012 12:07:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2012 12:07:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2012 12:07:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 33EA3238890B for ; Sun, 1 Apr 2012 12:07:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1308089 - in /apr/apr-util/branches/1.4.x: ./ CHANGES crypto/apr_crypto.c Date: Sun, 01 Apr 2012 12:07:32 -0000 To: commits@apr.apache.org From: minfrin@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120401120732.33EA3238890B@eris.apache.org> Author: minfrin Date: Sun Apr 1 12:07:31 2012 New Revision: 1308089 URL: http://svn.apache.org/viewvc?rev=1308089&view=rev Log: Backport: apr_crypto: Ensure the *driver variable is initialised when the library has already been loaded. Fix ported from apr_dbd. Modified: apr/apr-util/branches/1.4.x/ (props changed) apr/apr-util/branches/1.4.x/CHANGES apr/apr-util/branches/1.4.x/crypto/apr_crypto.c Propchange: apr/apr-util/branches/1.4.x/ ------------------------------------------------------------------------------ Merged /apr/apr/trunk:r1308087 Modified: apr/apr-util/branches/1.4.x/CHANGES URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/CHANGES?rev=1308089&r1=1308088&r2=1308089&view=diff ============================================================================== --- apr/apr-util/branches/1.4.x/CHANGES [utf-8] (original) +++ apr/apr-util/branches/1.4.x/CHANGES [utf-8] Sun Apr 1 12:07:31 2012 @@ -1,11 +1,16 @@ -*- coding: utf-8 -*- -Changes with APR-Util 1.4.2 +Changes with APR-util 1.4.3 + + *) apr_crypto: Ensure the *driver variable is initialised when the library + has already been loaded. Fix ported from apr_dbd. [Graham Leggett] + +Changes with APR-util 1.4.2 *) apr_crypto: Move the static initialisation of DRIVER_LOAD from apr_crypto_init() to apr_crypto_get_driver(), so that we don't lose the parameters. [Graham Leggett] -Changes with APR-Util 1.4.1 +Changes with APR-util 1.4.1 *) Apply Windows build fixes for the apr_crypto API. [Mladen Turk] Modified: apr/apr-util/branches/1.4.x/crypto/apr_crypto.c URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/crypto/apr_crypto.c?rev=1308089&r1=1308088&r2=1308089&view=diff ============================================================================== --- apr/apr-util/branches/1.4.x/crypto/apr_crypto.c (original) +++ apr/apr-util/branches/1.4.x/crypto/apr_crypto.c Sun Apr 1 12:07:31 2012 @@ -184,24 +184,16 @@ APU_DECLARE(apr_status_t) apr_crypto_get #endif apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name); rv = apu_dso_load(&dso, &symbol, modname, symname, pool); - if (rv != APR_SUCCESS) { /* APR_EDSOOPEN or APR_ESYMNOTFOUND? */ - if (rv == APR_EINIT) { /* previously loaded?!? */ - name = apr_pstrdup(pool, name); - apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); - rv = APR_SUCCESS; - } - goto unlock; - } - *driver = symbol; - if ((*driver)->init) { - rv = (*driver)->init(pool, params, result); - } - if (rv == APR_SUCCESS) { + if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */ + *driver = symbol; name = apr_pstrdup(pool, name); apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); + rv = APR_SUCCESS; + if ((*driver)->init) { + rv = (*driver)->init(pool, params, result); + } } - - unlock: apu_dso_mutex_unlock(); + apu_dso_mutex_unlock(); if (APR_SUCCESS != rv && result && !*result) { char *buffer = apr_pcalloc(pool, ERROR_SIZE);