From: Kurt Zeilenga Date: Fri, 3 Sep 1999 01:24:13 +0000 (+0000) Subject: Apply devel IDL fixes... X-Git-Tag: OPENLDAP_REL_ENG_1_2_7~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebc746bf35bff61e92869a63f8a21c6f6527bed5;p=thirdparty%2Fopenldap.git Apply devel IDL fixes... --- diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index a0466759b1..b6d6493253 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -464,7 +464,8 @@ idl_insert_key( rc = idl_change_first( be, db, key, idl, i, k2, tmp ); break; - case 2: /* id not inserted - already there */ + case 2: /* id not inserted - already there, do nothing */ + rc = 0; break; case 3: /* id not inserted - block is full */ @@ -485,7 +486,8 @@ idl_insert_key( Debug( LDAP_DEBUG_ANY, "idl_fetch_one (%s) returns NULL\n", k2.dptr, 0, 0 ); - break; + /* split the original block */ + goto split; } switch ( (rc = idl_insert( &tmp2, id, @@ -511,14 +513,19 @@ idl_insert_key( case 3: /* split the original block */ break; } + idl_free( tmp2 ); } +split: /* * must split the block, write both new blocks + update * and write the indirect header block. */ + rc = 0; /* optimistic */ + + /* count how many indirect blocks *//* XXX linear count XXX */ for ( j = 0; !ID_BLOCK_NOID(idl, j); j++ ) ; /* NULL */