]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slapi/plugin.c
Add ability to cache negative results and specify negative TTL on templates
[openldap] / servers / slapd / slapi / plugin.c
index 93809179d56d64cd29dcfa291de503bb341c2e5f..22e482328a414782d9a6e21e35c9adc5ed2c99bf 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2002-2005 The OpenLDAP Foundation.
+ * Copyright 2002-2006 The OpenLDAP Foundation.
  * Portions Copyright 1997,2002-2003 IBM Corporation.
  * All rights reserved.
  *
@@ -552,11 +552,15 @@ slapi_int_load_plugin(
        /* load in the module */
        *pLdHandle = lt_dlopen( path );
        if ( *pLdHandle == NULL ) {
+               fprintf( stderr, "failed to load plugin %s: %s\n",
+                        path, lt_dlerror() );
                return LDAP_LOCAL_ERROR;
        }
 
        fpInitFunc = (SLAPI_FUNC)lt_dlsym( *pLdHandle, initfunc );
        if ( fpInitFunc == NULL ) {
+               fprintf( stderr, "failed to find symbol %s in plugin %s: %s\n",
+                        initfunc, path, lt_dlerror() );
                lt_dlclose( *pLdHandle );
                return LDAP_LOCAL_ERROR;
        }
@@ -640,8 +644,8 @@ slapi_int_read_config(
        }
 
        /* automatically instantiate overlay if necessary */
-       if ( !overlay_is_inst( be, SLAPI_OVERLAY_NAME ) ) {
-               if ( overlay_config( be, SLAPI_OVERLAY_NAME ) != 0 ) {
+       if ( !slapi_over_is_inst( be ) ) {
+               if ( slapi_over_config( be ) != 0 ) {
                        fprintf( stderr, "Failed to instantiate SLAPI overlay\n");
                        return -1;
                }
@@ -734,29 +738,3 @@ slapi_int_plugin_unparse(
        }
 }
 
-int
-slapi_int_initialize(void)
-{
-       if ( ldap_pvt_thread_mutex_init( &slapi_hn_mutex ) ) {
-               return -1;
-       }
-       
-       if ( ldap_pvt_thread_mutex_init( &slapi_time_mutex ) ) {
-               return -1;
-       }
-
-       if ( ldap_pvt_thread_mutex_init( &slapi_printmessage_mutex ) ) {
-               return -1;
-       }
-
-       slapi_log_file = slapi_ch_strdup( LDAP_RUNDIR LDAP_DIRSEP "errors" );
-       if ( slapi_log_file == NULL ) {
-               return -1;
-       }
-
-       if ( slapi_int_init_object_extensions() != 0 ) {
-               return -1;
-       }
-
-       return slapi_int_overlay_init();
-}