cleanup names

This commit is contained in:
Pierangelo Masarati 2006-09-08 22:10:49 +00:00
parent 0e385af975
commit 4350ce5189
2 changed files with 16 additions and 16 deletions

View File

@ -150,12 +150,12 @@ struct bdb_db_info {
DB *bdi_db;
};
typedef struct bdb_monitor_cleanup_t {
typedef struct bdb_monitor_t {
void *bdm_cb;
struct berval bdm_base;
struct berval bdm_nbase;
int bdm_scope;
struct berval bdm_filter;
} bdb_monitor_cleanup_t;
} bdb_monitor_t;
/* From ldap_rq.h */
struct re_s;
@ -203,7 +203,7 @@ struct bdb_info {
alock_info_t bi_alock_info;
char *bi_db_config_path;
BerVarray bi_db_config;
bdb_monitor_cleanup_t bi_monitor_cleanup;
bdb_monitor_t bi_monitor;
int bi_flags;
#define BDB_IS_OPEN 0x01
#define BDB_HAS_CONFIG 0x02

View File

@ -368,10 +368,10 @@ bdb_monitor_open( BackendDB *be )
* base="cn=Databases,cn=Monitor", scope=LDAP_SCOPE_ONE
* and filter="(namingContexts:distinguishedNameMatch:=<suffix>)" */
bdb->bi_monitor_cleanup.bdm_scope = LDAP_SCOPE_ONELEVEL;
base = &bdb->bi_monitor_cleanup.bdm_base;
bdb->bi_monitor.bdm_scope = LDAP_SCOPE_ONELEVEL;
base = &bdb->bi_monitor.bdm_nbase;
BER_BVSTR( base, "cn=databases,cn=monitor" );
filter = &bdb->bi_monitor_cleanup.bdm_filter;
filter = &bdb->bi_monitor.bdm_filter;
BER_BVZERO( filter );
suffix.bv_len = ldap_bv2escaped_filter_value_len( &be->be_nsuffix[ 0 ] );
@ -504,7 +504,7 @@ cleanup:;
}
/* store for cleanup */
bdb->bi_monitor_cleanup.bdm_cb = (void *)cb;
bdb->bi_monitor.bdm_cb = (void *)cb;
/* we don't need to keep track of the attributes, because
* bdb_monitor_free() takes care of everything */
@ -523,18 +523,18 @@ bdb_monitor_close( BackendDB *be )
{
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
if ( !BER_BVISNULL( &bdb->bi_monitor_cleanup.bdm_filter ) ) {
if ( !BER_BVISNULL( &bdb->bi_monitor.bdm_filter ) ) {
monitor_back_unregister_entry_callback( NULL,
(monitor_callback_t *)bdb->bi_monitor_cleanup.bdm_cb,
&bdb->bi_monitor_cleanup.bdm_base,
bdb->bi_monitor_cleanup.bdm_scope,
&bdb->bi_monitor_cleanup.bdm_filter );
(monitor_callback_t *)bdb->bi_monitor.bdm_cb,
&bdb->bi_monitor.bdm_nbase,
bdb->bi_monitor.bdm_scope,
&bdb->bi_monitor.bdm_filter );
if ( !BER_BVISNULL( &bdb->bi_monitor_cleanup.bdm_filter ) ) {
ch_free( bdb->bi_monitor_cleanup.bdm_filter.bv_val );
if ( !BER_BVISNULL( &bdb->bi_monitor.bdm_filter ) ) {
ch_free( bdb->bi_monitor.bdm_filter.bv_val );
}
memset( &bdb->bi_monitor_cleanup, 0, sizeof( bdb->bi_monitor_cleanup ) );
memset( &bdb->bi_monitor, 0, sizeof( bdb->bi_monitor ) );
}
return 0;