Skip to content
Snippets Groups Projects
Commit 5b0e434d authored by Juan Gomez's avatar Juan Gomez
Browse files

Enabled deletion of stale index entries. (EXPERIMENTAL)

parent e1819eaf
No related branches found
No related tags found
No related merge requests found
......@@ -193,7 +193,54 @@ delete_value(
)
{
return 0;
int rc;
Datum key;
/* XXX do we need idl ??? */
ID_BLOCK *idl = NULL;
char *tmpval = NULL;
char *realval = val;
char buf[BUFSIZ];
char prefix = index2prefix( indextype );
ldbm_datum_init( key );
Debug( LDAP_DEBUG_TRACE,
"=> delete_value( \"%c%s\" )\n",
prefix, val, 0 );
if ( prefix != UNKNOWN_PREFIX ) {
unsigned int len = strlen( val );
if ( (len + 2) < sizeof(buf) ) {
realval = buf;
} else {
/* value + prefix + null */
tmpval = (char *) ch_malloc( len + 2 );
realval = tmpval;
}
realval[0] = prefix;
strcpy( &realval[1], val );
}
key.dptr = realval;
key.dsize = strlen( realval ) + 1;
rc = idl_delete_key( be, db, key, id );
if ( tmpval != NULL ) {
free( tmpval );
}
if( idl != NULL ) {
idl_free( idl );
}
ldap_pvt_thread_yield();
Debug( LDAP_DEBUG_TRACE, "<= delete_value %d\n", rc, 0, 0 );
return( rc );
}/* static int delete_value() */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment