Commit e9188de7 authored by Howard Chu's avatar Howard Chu
Browse files

Replaced slap_overinfo.oi_bd with oi_orig.

parent 09a37939
......@@ -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 ),
......
......@@ -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;
......
......@@ -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? */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment