Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", op->o_req_dn.bv_val, 0, 0);
#endif
-#ifndef LDAP_CACHING
rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL, &rs->sr_text, textbuf, textlen );
-#else /* LDAP_CACHING */
- if ( !op->o_caching_on ) {
- rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL, &rs->sr_text, textbuf, textlen );
- } else {
- rs->sr_err = LDAP_SUCCESS;
- }
-#endif /* LDAP_CACHING */
if ( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
subentry = is_entry_subentry( op->oq_add.rs_e );
#endif
-#ifdef LDAP_CACHING
- if ( !op->o_caching_on ) {
-#endif /* LDAP_CACHING */
if ( !access_allowed( op, op->oq_add.rs_e,
entry, NULL, ACL_WRITE, NULL ) )
{
return -1;
#endif
}
-#ifdef LDAP_CACHING
- }
-#endif /* LDAP_CACHING */
/* grab giant lock for writing */
ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock);
dnParent( &op->o_req_ndn, &pdn );
}
-#ifndef LDAP_CACHING
if( pdn.bv_len )
-#else /* LDAP_CACHING */
- if( pdn.bv_len && !op->o_caching_on )
-#endif /* LDAP_CACHING */
{
Entry *matched = NULL;
#endif
} else {
-#ifndef LDAP_CACHING
if( pdn.bv_val != NULL )
-#else /* LDAP_CACHING */
- if( pdn.bv_val != NULL && !op->o_caching_on )
-#endif /* LDAP_CACHING */
{
assert( *pdn.bv_val == '\0' );
}
/* no parent, must be adding entry to root */
-#ifndef LDAP_CACHING
if ( !be_isroot( op->o_bd, &op->o_ndn ) )
-#else /* LDAP_CACHING */
- if ( !be_isroot( op->o_bd, &op->o_ndn ) && !op->o_caching_on )
-#endif /* LDAP_CACHING */
{
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op->o_bd, &op->o_ndn ) ) {
p = (Entry *)&slap_entry_root;
}
/* check entry for "entry" acl */
-#ifdef LDAP_CACHING
- if( !op->o_caching_on ) {
-#endif /* LDAP_CACHING */
if ( ! access_allowed( op, e,
entry, NULL, ACL_WRITE, NULL ) )
{
}
}
}
-#ifdef LDAP_CACHING
- }
-#endif /* LDAP_CACHING */
/* delete from dn2id mapping */
if ( dn2id_delete( op->o_bd, &e->e_nname, e->e_id ) != 0 ) {
}
/* check that the entry still obeys the schema */
-#ifndef LDAP_CACHING
rc = entry_schema_check( op->o_bd, e, save_attrs, text, textbuf, textlen );
-#else /* LDAP_CACHING */
- if ( !op->o_caching_on ) {
- rc = entry_schema_check( op->o_bd, e, save_attrs,
- text, textbuf, textlen );
- } else {
- rc = LDAP_SUCCESS;
- }
-#endif /* LDAP_CACHING */
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
#endif
}
-#ifndef LDAP_CACHING
if ( !manageDSAit && is_entry_referral( e ) )
-#else /* LDAP_CACHING */
- if ( !op->o_caching_on && !manageDSAit && is_entry_referral( e ) )
-#endif /* LDAP_CACHING */
{
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
/* grab giant lock for reading */
ldap_pvt_thread_rdwr_rlock(&li->li_giant_rwlock);
-#ifndef LDAP_CACHING
if ( op->o_req_ndn.bv_len == 0 ) {
/* DIT root special case */
e = (Entry *) &slap_entry_root;
/* need normalized dn below */
ber_dupbv( &realbase, &e->e_nname );
-#else /* LDAP_CACHING */
- if ( op->o_caching_on || op->o_req_ndn.bv_len == 0 ) {
- if (op->o_req_ndn.bv_len == 0) {
- e = (Entry *) &slap_entry_root;
- /* need normalized dn below */
- ber_dupbv( &realbase, &e->e_nname );
- } else {
- if ((op->oq_search.rs_scope == LDAP_SCOPE_BASE)
- && (e = dn2entry_r( op->o_bd, &op->o_req_ndn, &matched )))
- {
- candidates = base_candidate(op->o_bd, e);
- cache_return_entry_r( &li->li_cache, e );
- goto searchit;
- }
- cache_base_entry.e_nname = op->o_req_ndn;
- e = &cache_base_entry;
- }
-#endif /* LDAP_CACHING */
-
candidates = search_candidates( op, e, op->oq_search.rs_filter,
op->oq_search.rs_scope, op->oq_search.rs_deref,
manageDSAit || get_domainScope(op) );
Debug( LDAP_DEBUG_TRACE, "ldbm_search: no candidates\n",
0, 0, 0 );
#endif
-#ifdef LDAP_CACHING
- if ( op->o_caching_on ) {
- ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);
- }
-#endif /* LDAP_CACHING */
rs->sr_err = LDAP_SUCCESS;
send_ldap_result( op, rs );
-#ifdef LDAP_CACHING
- if ( op->o_caching_on ) {
- ldap_pvt_thread_rdwr_rlock(&li->li_giant_rwlock);
- }
-#endif /* LDAP_CACHING */
-
#ifdef LDAP_SYNCREPL
rc = LDAP_OTHER;
#else
}
/* if not root, get appropriate limits */
-#ifndef LDAP_CACHING
if ( be_isroot( op->o_bd, &op->o_ndn ) )
-#else /* LDAP_CACHING */
- if ( op->o_caching_on || be_isroot( op->o_bd, &op->o_ndn ) )
-#endif /* LDAP_CACHING */
{
/*
* FIXME: I'd consider this dangerous if someone
}
#endif
-#ifdef LDAP_CACHING
- if ( !op->o_caching_on ) {
-#endif /* LDAP_CACHING */
-
if ( op->oq_search.rs_deref & LDAP_DEREF_SEARCHING && is_entry_alias( e ) ) {
Entry *matched;
int err;
goto loop_continue;
}
-#ifdef LDAP_CACHING
- }
-#endif /* LDAP_CACHING */
-
#ifdef LDAP_SYNCREPL
if ( !manageDSAit && is_entry_glue( e )) {
goto loop_continue;
if (e) {
-#ifdef LDAP_CACHING
- if ( op->o_caching_on ) {
- ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);
- cache_return_entry_r( &li->li_cache, e );
- }
-#endif /* LDAP_CACHING */
-
result = send_search_entry( op, rs );
-#ifdef LDAP_CACHING
- if ( op->o_caching_on ) {
- ldap_pvt_thread_rdwr_rlock( &li->li_giant_rwlock );
- }
-#endif /* LDAP_CACHING */
-
-
switch (result) {
case 0: /* entry sent ok */
break;
loop_continue:
if( e != NULL ) {
/* free reader lock */
-#ifndef LDAP_CACHING
cache_return_entry_r( &li->li_cache, e );
-#else /* LDAP_CACHING */
- if ( !op->o_caching_on ) {
- cache_return_entry_r( &li->li_cache, e );
- }
-#endif /* LDAP_CACHING */
}
ldap_pvt_thread_yield();
op_tmp.o_tag = LDAP_REQ_ADD;
op_tmp.o_protocol = LDAP_VERSION3;
op_tmp.o_callback = &cb;
- op_tmp.o_caching_on = 0;
op_tmp.o_time = slap_get_time();
op_tmp.o_do_not_cache = 1;
op_tmp.o_callback = &cb;
op_tmp.o_time = slap_get_time();
op_tmp.o_do_not_cache = 1;
- op_tmp.o_caching_on = 0;
op_tmp.o_req_dn = op->o_bd->be_suffix[0];
op_tmp.o_req_ndn = op->o_bd->be_nsuffix[0];
op_tmp.o_req_dn = cachebase;
op_tmp.o_req_ndn = ncachebase;
- op_tmp.o_caching_on = 0;
op_tmp.o_callback = &cb;
li->glue_be->be_search(&op_tmp, rs);
syncinfo_t* o_si;
#endif
-#ifdef LDAP_CACHING
- char o_caching_on;
-#endif /*LDAP_CACHING */
-
#ifdef LDAP_SLAPI
void *o_pb; /* NS-SLAPI plugin */
void *o_extensions; /* NS-SLAPI plugin */