From e9188de738d2f5ee7866ba40714e1592f75173be Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 20 Mar 2004 12:56:31 +0000 Subject: [PATCH] Replaced slap_overinfo.oi_bd with oi_orig. --- servers/slapd/back-monitor/database.c | 12 ++++++---- servers/slapd/backover.c | 33 +++++++++++++-------------- servers/slapd/slap.h | 4 ++-- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 3442106bb0..2ca220dc63 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -73,13 +73,15 @@ monitor_subsys_database_init( char buf[ BACKMONITOR_BUFSIZE ]; int j; slap_overinfo *oi = NULL; + BackendInfo *bi; be = &backendDB[i]; + bi = be->bd_info; + if ( strcmp( be->bd_info->bi_type, "over" ) == 0 ) { oi = (slap_overinfo *)be->bd_info; - - be = &oi->oi_bd; + bi = oi->oi_orig; } /* Subordinates are not exposed as their own naming context */ @@ -102,7 +104,7 @@ monitor_subsys_database_init( mi->mi_oc_monitoredObject->soc_cname.bv_val, i, mi->mi_ad_monitoredInfo->ad_cname.bv_val, - be->bd_info->bi_type, + bi->bi_type, mi->mi_startTime.bv_val, mi->mi_startTime.bv_val ); @@ -166,7 +168,7 @@ monitor_subsys_database_init( } #if defined(SLAPD_LDAP) - if ( strcmp( be->bd_info->bi_type, "ldap" ) == 0 ) { + if ( strcmp( bi->bi_type, "ldap" ) == 0 ) { struct ldapinfo *li = (struct ldapinfo *)be->be_private; struct berval bv; @@ -178,7 +180,7 @@ monitor_subsys_database_init( #endif /* defined(SLAPD_LDAP) */ for ( j = nBackendInfo; j--; ) { - if ( backendInfo[ j ].bi_type == be->bd_info->bi_type ) { + if ( backendInfo[ j ].bi_type == bi->bi_type ) { struct berval bv; snprintf( buf, sizeof( buf ), diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index fed40f1cfd..060d7b0245 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -38,25 +38,23 @@ over_db_func( { slap_overinfo *oi = (slap_overinfo *) be->bd_info; slap_overinst *on = oi->oi_list; - BackendDB bd; BI_db_open **func; int rc = 0; - func = &oi->oi_bd.bd_info->bi_db_open; + func = &oi->oi_orig->bi_db_open; if ( func[which] ) { - rc = func[which]( &oi->oi_bd ); - if ( rc ) return rc; + be->bd_info = oi->oi_orig; + rc = func[which]( be ); } - bd = *be; - for (; on; on=on->on_next) { - bd.bd_info = &on->on_bi; + for (; on && rc == 0; on=on->on_next) { + be->bd_info = &on->on_bi; func = &on->on_bi.bi_db_open; if (func[which]) { - rc = func[which]( &bd ); - if ( rc ) break; + rc = func[which]( be ); } } + be->bd_info = (BackendInfo *)oi; return rc; } @@ -71,24 +69,25 @@ over_db_config( { slap_overinfo *oi = (slap_overinfo *) be->bd_info; slap_overinst *on = oi->oi_list; - BackendDB bd; int rc = 0; - if ( oi->oi_bd.bd_info->bi_db_config ) { - rc = oi->oi_bd.bd_info->bi_db_config( &oi->oi_bd, fname, lineno, + if ( oi->oi_orig->bi_db_config ) { + be->bd_info = oi->oi_orig; + rc = oi->oi_orig->bi_db_config( be, fname, lineno, argc, argv ); + be->bd_info = (BackendInfo *)oi; if ( rc != SLAP_CONF_UNKNOWN ) return rc; } - bd = *be; for (; on; on=on->on_next) { - bd.bd_info = &on->on_bi; if (on->on_bi.bi_db_config) { - rc = on->on_bi.bi_db_config( &bd, fname, lineno, + be->bd_info = &on->on_bi; + rc = on->on_bi.bi_db_config( be, fname, lineno, argc, argv ); if ( rc != SLAP_CONF_UNKNOWN ) break; } } + be->bd_info = (BackendInfo *)oi; return rc; } @@ -180,7 +179,7 @@ over_op_func( } op->o_bd = be; - func = &oi->oi_bd.bd_info->bi_op_bind; + func = &oi->oi_orig->bi_op_bind; if ( func[which] && rc == SLAP_CB_CONTINUE ) { rc = func[which]( op, rs ); } @@ -304,7 +303,7 @@ overlay_config( BackendDB *be, const char *ov ) */ if ( be->bd_info->bi_type != overtype ) { oi = ch_malloc( sizeof(slap_overinfo) ); - oi->oi_bd = *be; + oi->oi_orig = be->bd_info; oi->oi_bi = *be->bd_info; oi->oi_list = NULL; bi = (BackendInfo *)oi; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 52fdceeb50..fe07730bee 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1857,8 +1857,8 @@ typedef struct slap_overinst { typedef struct slap_overinfo { BackendInfo oi_bi; - BackendDB oi_bd; - slap_overinst *oi_list; + BackendInfo *oi_orig; + struct slap_overinst *oi_list; } slap_overinfo; /* Should successive callbacks in a chain be processed? */ -- 2.39.5