From 2d68ec09f2692fa4832e274fb026641be1ea3bc7 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 5 Apr 2003 03:11:29 +0000 Subject: [PATCH] #unifdef -DSLAP_NVALUES_ON_DISK --- servers/slapd/back-bdb/id2entry.c | 12 ---------- servers/slapd/entry.c | 39 +++---------------------------- servers/slapd/slap.h | 1 - 3 files changed, 3 insertions(+), 49 deletions(-) diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index 151fbb0ebe..21478685de 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -205,18 +205,6 @@ int bdb_entry_return( if( (void *) e->e_attrs != (void *) (e+1)) { attrs_free( e->e_attrs ); } -#if defined(SLAP_NVALUES) && !defined(SLAP_NVALUES_ON_DISK) - else { - /* nvals are not contiguous with the rest. oh well. */ - Attribute *a; - for (a = e->e_attrs; a; a=a->a_next) { - if (a->a_nvals != a->a_vals) { - ber_bvarray_free( a->a_nvals ); - a->a_nvals = NULL; - } - } - } -#endif #ifndef BDB_HIER /* See if the DNs were changed by modrdn */ diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index 745e96a2e9..ca9ed153d7 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -544,7 +544,7 @@ int entry_encode(Entry *e, struct berval *bv) } len += entry_lenlen(i); siz += sizeof(struct berval); /* empty berval at end */ -#ifdef SLAP_NVALUES_ON_DISK +#ifdef SLAP_NVALUES if (a->a_nvals != a->a_vals) { for (i=0; a->a_nvals[i].bv_val; i++) { siz += sizeof(struct berval); @@ -589,7 +589,7 @@ int entry_encode(Entry *e, struct berval *bv) ptr += a->a_vals[i].bv_len; *ptr++ = '\0'; } -#ifdef SLAP_NVALUES_ON_DISK +#ifdef SLAP_NVALUES if (a->a_nvals != a->a_vals) { entry_putlen(&ptr, i); for (i=0; a->a_nvals[i].bv_val; i++) { @@ -709,7 +709,7 @@ int entry_decode(struct berval *bv, Entry **e) bptr->bv_len = 0; bptr++; -#ifdef SLAP_NVALUES_ON_DISK +#ifdef SLAP_NVALUES j = entry_getlen(&ptr); if (j) { a->a_nvals = bptr; @@ -727,40 +727,7 @@ int entry_decode(struct berval *bv, Entry **e) } else { a->a_nvals = a->a_vals; } -#elif defined(SLAP_NVALUES) - if( count && ad->ad_type->sat_equality && - ad->ad_type->sat_equality->smr_normalize ) - { - a->a_nvals = ch_malloc((count+1)*sizeof(struct berval)); - - for(j=0; jad_type->sat_equality->smr_normalize( - SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX, - ad->ad_type->sat_syntax, - ad->ad_type->sat_equality, - &a->a_vals[j], &a->a_nvals[j] ); - - if( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "entry_decode: NULL (smr_normalize %d)\n", - rc, 0, 0 ); -#else - Debug( LDAP_DEBUG_ANY, - "<= entry_decode NULL (smr_normalize %d)\n", - rc, 0, 0 ); -#endif - - return rc; - } - } - a->a_nvals[j].bv_val = NULL; - a->a_nvals[j].bv_len = 0; - } else { - a->a_nvals = a->a_vals; - } #endif - } if (a) a->a_next = NULL; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 168cf296db..585b9090a8 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -37,7 +37,6 @@ #ifdef LDAP_DEVEL #define SLAP_NVALUES 1 -#define SLAP_NVALUES_ON_DISK 1 #define SLAP_EXTENDED_SCHEMA 1 #define LDAP_CACHING #endif -- 2.39.5