mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 09:09:54 -05:00
Go back to original startup/shutdown behavior. Fix entry_release.
This commit is contained in:
parent
8a4931c4d6
commit
2c25924d28
1 changed files with 33 additions and 9 deletions
|
|
@ -419,15 +419,16 @@ glue_open (
|
|||
{
|
||||
slap_overinst *on = glue_tool_inst( bi );
|
||||
glueinfo *gi = on->on_bi.bi_private;
|
||||
static int glueOpened = 0;
|
||||
int i, rc = 0;
|
||||
|
||||
if (glueOpened) return 0;
|
||||
|
||||
glueOpened = 1;
|
||||
|
||||
/* If we were invoked in tool mode, open all the underlying backends */
|
||||
if (slapMode & SLAP_TOOL_MODE) {
|
||||
for ( i=0; i<gi->gi_nodes; i++ ) {
|
||||
gi->gi_n[i].gn_be = backendDB + gi->gi_n[i].gn_bx;
|
||||
rc = backend_startup( gi->gi_n[i].gn_be );
|
||||
if ( rc ) break;
|
||||
}
|
||||
rc = backend_startup( NULL );
|
||||
} /* other case is impossible */
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -440,17 +441,38 @@ glue_close (
|
|||
{
|
||||
slap_overinst *on = glue_tool_inst( bi );
|
||||
glueinfo *gi = on->on_bi.bi_private;
|
||||
static int glueClosed = 0;
|
||||
int i, rc = 0;
|
||||
|
||||
if (glueClosed) return 0;
|
||||
|
||||
glueClosed = 1;
|
||||
|
||||
if (slapMode & SLAP_TOOL_MODE) {
|
||||
for ( i=0; i<gi->gi_nodes; i++ ) {
|
||||
rc = backend_shutdown( gi->gi_n[i].gn_be );
|
||||
if ( rc ) break;
|
||||
}
|
||||
rc = backend_shutdown( NULL );
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
glue_entry_release_rw (
|
||||
Operation *op,
|
||||
Entry *e,
|
||||
int rw
|
||||
)
|
||||
{
|
||||
BackendDB *b0, b2;
|
||||
int rc;
|
||||
|
||||
b0 = op->o_bd;
|
||||
b2.bd_info = (BackendInfo *)glue_tool_inst( op->o_bd->bd_info );
|
||||
op->o_bd = glue_back_select (&b2, &e->e_nname);
|
||||
|
||||
rc = op->o_bd->be_release( op, e, rw );
|
||||
op->o_bd = b0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static ID
|
||||
glue_tool_entry_first (
|
||||
BackendDB *b0
|
||||
|
|
@ -610,6 +632,8 @@ glue_db_init(
|
|||
oi->oi_bi.bi_open = glue_open;
|
||||
oi->oi_bi.bi_close = glue_close;
|
||||
|
||||
oi->oi_bi.bi_entry_release_rw = glue_entry_release_rw;
|
||||
|
||||
oi->oi_bi.bi_tool_entry_open = glue_tool_entry_open;
|
||||
oi->oi_bi.bi_tool_entry_close = glue_tool_entry_close;
|
||||
oi->oi_bi.bi_tool_entry_first = glue_tool_entry_first;
|
||||
|
|
|
|||
Loading…
Reference in a new issue