apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
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 GMT
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);



Mime
View raw message