New call to unregister controls registered form overlays

This commit is contained in:
Ralf Haferkamp 2010-07-01 11:28:47 +00:00
parent b435efa694
commit 7f70a7aad6
2 changed files with 33 additions and 0 deletions

View File

@ -1088,6 +1088,36 @@ overlay_register_control( BackendDB *be, const char *oid )
return 0;
}
#ifdef SLAP_CONFIG_DELETE
void
overlay_unregister_control( BackendDB *be, const char *oid )
{
int gotit = 0;
int cid;
if ( slap_find_control_id( oid, &cid ) == LDAP_CONTROL_NOT_FOUND ) {
return;
}
if ( SLAP_ISGLOBALOVERLAY( be ) ) {
BackendDB *bd;
/* remove from all backends... */
LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
if ( bd == be->bd_self ) {
gotit = 1;
}
bd->be_ctrls[ cid ] = 0;
}
}
if ( !gotit ) {
be->bd_self->be_ctrls[ cid ] = 0;
}
}
#endif /* SLAP_CONFIG_DELETE */
void
overlay_destroy_one( BackendDB *be, slap_overinst *on )
{

View File

@ -483,6 +483,9 @@ LDAP_SLAPD_F (void) overlay_move LDAP_P((
#ifdef SLAP_CONFIG_DELETE
LDAP_SLAPD_F (void) overlay_remove LDAP_P((
BackendDB *be, slap_overinst *on ));
LDAP_SLAPD_F (void) overlay_unregister_control LDAP_P((
BackendDB *be,
const char *oid ));
#endif /* SLAP_CONFIG_DELETE */
LDAP_SLAPD_F (int) overlay_callback_after_backover LDAP_P((
Operation *op, slap_callback *sc, int append ));