apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1308087 - in /apr/apr/trunk: CHANGES crypto/apr_crypto.c
Date Sun, 01 Apr 2012 12:00:12 GMT
Author: minfrin
Date: Sun Apr  1 12:00:12 2012
New Revision: 1308087

URL: http://svn.apache.org/viewvc?rev=1308087&view=rev
Log:
apr_crypto: Ensure the *driver variable is initialised when the library
has already been loaded. Fix ported from apr_dbd.

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/crypto/apr_crypto.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=1308087&r1=1308086&r2=1308087&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Sun Apr  1 12:00:12 2012
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 2.0.0
 
+  *) apr_crypto: Ensure the *driver variable is initialised when the library
+     has already been loaded. Fix ported from apr_dbd. [Graham Leggett]
+
   *) apr_file_open: Avoid fcntl() calls if support for O_CLOEXEC works.
      PR 48557. [Mike Frysinger <vapier gentoo org>]
 

Modified: apr/apr/trunk/crypto/apr_crypto.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/crypto/apr_crypto.c?rev=1308087&r1=1308086&r2=1308087&view=diff
==============================================================================
--- apr/apr/trunk/crypto/apr_crypto.c (original)
+++ apr/apr/trunk/crypto/apr_crypto.c Sun Apr  1 12:00:12 2012
@@ -178,24 +178,16 @@ APR_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