]> git.sur5r.net Git - openldap/commitdiff
Replaced slap_overinfo.oi_bd with oi_orig.
authorHoward Chu <hyc@openldap.org>
Sat, 20 Mar 2004 12:56:31 +0000 (12:56 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 20 Mar 2004 12:56:31 +0000 (12:56 +0000)
servers/slapd/back-monitor/database.c
servers/slapd/backover.c
servers/slapd/slap.h

index 3442106bb0fea7641e209ac9a0cdf2c881f40d5d..2ca220dc631f6abe9b2f61356ffac7da81462fcc 100644 (file)
@@ -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 ), 
index fed40f1cfd0c90c20d5a88f65cb638c0622f73c7..060d7b0245177e1f9301b242819dd1df3217d924 100644 (file)
@@ -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;
index 52fdceeb5076b7732bb6a4a9df690a560ecd41ed..fe07730bee4128219398b468cc2216912ca5274f 100644 (file)
@@ -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? */