From b2075ea932aaf7bbc9f9160bffc5355da6ddfb43 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 5 Apr 2003 09:57:21 +0000 Subject: [PATCH] cleanup & more --- servers/slapd/back-bdb/proto-bdb.h | 2 ++ servers/slapd/back-bdb/search.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/servers/slapd/back-bdb/proto-bdb.h b/servers/slapd/back-bdb/proto-bdb.h index 0844f0934b..4fd7d8a75f 100644 --- a/servers/slapd/back-bdb/proto-bdb.h +++ b/servers/slapd/back-bdb/proto-bdb.h @@ -179,6 +179,8 @@ int bdb_idl_fetch_key( DBT *key, ID *ids ); +int bdb_idl_insert( ID *ids, ID id ); + int bdb_idl_insert_key( BackendDB *be, DB *db, diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 99fb0f4243..5b1ded7912 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -46,7 +46,6 @@ static Entry * deref_base ( { struct bdb_info *bdb = (struct bdb_info *) be->be_private; struct berval ndn; - unsigned x; DB_LOCK lockr; rs->sr_err = LDAP_ALIAS_DEREF_PROBLEM; @@ -356,7 +355,9 @@ int bdb_search( Operation *op, SlapReply *rs ) Filter cookief, csnfnot, csnfeq, csnfand, csnfge; AttributeAssertion aa_ge, aa_eq; int entry_count = 0; +#if 0 struct berval entrycsn_bv = { 0, NULL }; +#endif struct berval latest_entrycsn_bv = { 0, NULL }; LDAPControl *ctrls[SLAP_SEARCH_MAX_CTRLS]; int num_ctrls = 0; @@ -1067,7 +1068,8 @@ id2entry_retry: #endif if (e) { - int result; + /* safe default */ + int result = -1; #if 0 /* noop is masked SLAP_CTRL_UPDATE */ if( op->o_noop ) { @@ -1421,7 +1423,7 @@ static void *search_stack( if ( !ret ) { ret = ch_malloc( bdb->bi_search_stack_depth * BDB_IDL_UM_SIZE - * sizeof ID ); + * sizeof( ID ) ); if ( op->o_threadctx ) { ldap_pvt_thread_pool_setkey( op->o_threadctx, search_stack, ret, search_stack_free ); @@ -1641,7 +1643,6 @@ bdb_build_lcup_update_ctrl( Attribute* a; int ret; int res; - int rc; const char *text = NULL; char berbuf[LBER_ELEMENT_SIZEOF]; @@ -1732,7 +1733,7 @@ bdb_build_lcup_done_ctrl( int num_ctrls, struct berval *latest_entrycsn_bv ) { - int ret, rc; + int ret; char berbuf[LBER_ELEMENT_SIZEOF]; BerElement *ber = (BerElement *)berbuf; @@ -1780,7 +1781,6 @@ bdb_build_sync_state_ctrl( Attribute* a; int ret; int res; - int rc; const char *text = NULL; char berbuf[LBER_ELEMENT_SIZEOF]; @@ -1871,7 +1871,7 @@ bdb_build_sync_done_ctrl( int send_cookie, struct berval *latest_entrycsn_bv ) { - int ret,rc; + int ret; char berbuf[LBER_ELEMENT_SIZEOF]; BerElement *ber = (BerElement *)berbuf; @@ -1919,7 +1919,7 @@ bdb_send_ldap_intermediate( BerElement *ber = (BerElement *)berbuf; struct berval rspdata; - int ret, rc; + int ret; ber_init2( ber, NULL, LBER_USE_DER );