You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by mi...@apache.org on 2008/09/07 21:48:03 UTC
svn commit: r692924 - in /apr/apr-util/trunk: CHANGES dbd/apr_dbd.c
include/private/apu_internal.h ldap/apr_ldap_stub.c misc/apu_dso.c
Author: minfrin
Date: Sun Sep 7 12:48:02 2008
New Revision: 692924
URL: http://svn.apache.org/viewvc?rev=692924&view=rev
Log:
Expose the apr_dso_handle_t when calling apu_dso_load, so that the
crypto code can call apr_dso_error and find out why the dso load
failed. The existing LDAP and DBD code ignores this, as their APIs
do not yet allow for errors to be returned.
Modified:
apr/apr-util/trunk/CHANGES
apr/apr-util/trunk/dbd/apr_dbd.c
apr/apr-util/trunk/include/private/apu_internal.h
apr/apr-util/trunk/ldap/apr_ldap_stub.c
apr/apr-util/trunk/misc/apu_dso.c
Modified: apr/apr-util/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/CHANGES?rev=692924&r1=692923&r2=692924&view=diff
==============================================================================
--- apr/apr-util/trunk/CHANGES [utf-8] (original)
+++ apr/apr-util/trunk/CHANGES [utf-8] Sun Sep 7 12:48:02 2008
@@ -1,6 +1,11 @@
-*- coding: utf-8 -*-
Changes with APR-util 1.4.0
+ *) Expose the apr_dso_handle_t when calling apu_dso_load, so that the
+ crypto code can call apr_dso_error and find out why the dso load
+ failed. The existing LDAP and DBD code ignores this, as their APIs
+ do not yet allow for errors to be returned. [Graham Leggett]
+
*) Fix a segfault in the DBD testcase when the DBD modules were not present.
[Graham Leggett]
Modified: apr/apr-util/trunk/dbd/apr_dbd.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd.c?rev=692924&r1=692923&r2=692924&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd.c Sun Sep 7 12:48:02 2008
@@ -39,7 +39,7 @@
#if APR_HAS_THREADS
/* deprecated, but required for existing providers. Existing and new
* providers should be refactored to use a provider-specific mutex so
- * that different providers do not block one another.
+ * that different providers do not block one another.
* In APR 1.3 this is no longer used for dso module loading, and
* apu_dso_mutex_[un]lock is used instead.
* In APR 2.0 this should become entirely local to libaprutil-2.so and
@@ -174,14 +174,14 @@
#if defined(NETWARE)
apr_snprintf(modname, sizeof(modname), "dbd%s.nlm", name);
#elif defined(WIN32)
- apr_snprintf(modname, sizeof(modname),
+ apr_snprintf(modname, sizeof(modname),
"apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name);
#else
- apr_snprintf(modname, sizeof(modname),
+ apr_snprintf(modname, sizeof(modname),
"apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", name);
#endif
apr_snprintf(symname, sizeof(symname), "apr_dbd_%s_driver", name);
- rv = apu_dso_load(&symbol, modname, symname, pool);
+ rv = apu_dso_load(NULL, &symbol, modname, symname, pool);
if (rv != APR_SUCCESS) { /* APR_EDSOOPEN or APR_ESYMNOTFOUND? */
if (rv == APR_EINIT) { /* previously loaded?!? */
name = apr_pstrdup(pool, name);
@@ -439,7 +439,7 @@
case 'c': t[i] = APR_DBD_TYPE_CLOB; q += 2; break;
case 'n': t[i] = APR_DBD_TYPE_NULL; q += 2; break;
}
- }
+ }
break;
}
q++;
Modified: apr/apr-util/trunk/include/private/apu_internal.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/private/apu_internal.h?rev=692924&r1=692923&r2=692924&view=diff
==============================================================================
--- apr/apr-util/trunk/include/private/apu_internal.h (original)
+++ apr/apr-util/trunk/include/private/apu_internal.h Sun Sep 7 12:48:02 2008
@@ -31,13 +31,13 @@
* continue to initialize modules by multiple threads, the caller
* of apu_dso_load must lock first, and not unlock until any init
* finalization is complete.
- */
+ */
apr_status_t apu_dso_init(apr_pool_t *pool);
apr_status_t apu_dso_mutex_lock(void);
apr_status_t apu_dso_mutex_unlock(void);
-apr_status_t apu_dso_load(apr_dso_handle_sym_t *dsoptr, const char *module,
+apr_status_t apu_dso_load(apr_dso_handle_t **dso, apr_dso_handle_sym_t *dsoptr, const char *module,
const char *modsym, apr_pool_t *pool);
#if APR_HAS_LDAP
Modified: apr/apr-util/trunk/ldap/apr_ldap_stub.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/ldap/apr_ldap_stub.c?rev=692924&r1=692923&r2=692924&view=diff
==============================================================================
--- apr/apr-util/trunk/ldap/apr_ldap_stub.c (original)
+++ apr/apr-util/trunk/ldap/apr_ldap_stub.c Sun Sep 7 12:48:02 2008
@@ -52,7 +52,7 @@
#else
modname = "apr_ldap-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so";
#endif
- rv = apu_dso_load(&symbol, modname, "apr__ldap_fns", pool);
+ rv = apu_dso_load(NULL, &symbol, modname, "apr__ldap_fns", pool);
if (rv == APR_SUCCESS) {
lfn = symbol;
}
Modified: apr/apr-util/trunk/misc/apu_dso.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/misc/apu_dso.c?rev=692924&r1=692923&r2=692924&view=diff
==============================================================================
--- apr/apr-util/trunk/misc/apu_dso.c (original)
+++ apr/apr-util/trunk/misc/apu_dso.c Sun Sep 7 12:48:02 2008
@@ -103,7 +103,7 @@
}
#if APR_HAS_DSO
-apr_status_t apu_dso_load(apr_dso_handle_sym_t *dsoptr, const char *module,
+apr_status_t apu_dso_load(apr_dso_handle_t **dlhandleptr, apr_dso_handle_sym_t *dsoptr, const char *module,
const char *modsym, apr_pool_t *pool)
{
#if !APU_DSO_BUILD
@@ -159,6 +159,9 @@
apr_cpystrn(eos, module, sizeof(path) - (eos - path));
rv = apr_dso_load(&dlhandle, path, global);
+ if (dlhandleptr) {
+ *dlhandleptr = dlhandle;
+ }
if (rv == APR_SUCCESS) { /* APR_EDSOOPEN */
break;
}
@@ -175,6 +178,9 @@
apr_cpystrn(eos, module, sizeof(path) - (eos - path));
rv = apr_dso_load(&dlhandle, path, global);
+ if (dlhandleptr) {
+ *dlhandleptr = dlhandle;
+ }
if (rv == APR_SUCCESS) { /* APR_EDSOOPEN */
break;
}