/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
return SLAP_CB_CONTINUE;
}
-int slap_replog_cb( Operation *op, SlapReply *rs )
-{
- if ( rs->sr_err == LDAP_SUCCESS ) {
- replog( op );
- }
- return SLAP_CB_CONTINUE;
-}
-
static char *v2ref( BerVarray ref, const char *text )
{
size_t len = 0, i = 0;
bytes = send_ldap_ber( op->o_conn, ber );
ber_free_buf( ber );
- ldap_pvt_thread_mutex_lock( &slap_counters.sc_sent_mutex );
- ldap_pvt_mp_add_ulong( slap_counters.sc_bytes, (unsigned long)bytes );
- ldap_pvt_mp_add_ulong( slap_counters.sc_refs, 1 );
- ldap_pvt_mp_add_ulong( slap_counters.sc_pdu, 1 );
- ldap_pvt_thread_mutex_unlock( &slap_counters.sc_sent_mutex );
+ if ( bytes < 0 ) {
+ rc = LDAP_UNAVAILABLE;
+ } else {
+ ldap_pvt_thread_mutex_lock( &slap_counters.sc_sent_mutex );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_bytes, (unsigned long)bytes );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_refs, 1 );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_pdu, 1 );
+ ldap_pvt_thread_mutex_unlock( &slap_counters.sc_sent_mutex );
+ }
#ifdef LDAP_CONNECTIONLESS
}
#endif
op->o_preread_attrs : op->o_postread_attrs;
bv.bv_len = entry_flatsize( rs->sr_entry, 0 );
- bv.bv_val = op->o_tmpalloc(bv.bv_len, op->o_tmpmemctx );
+ bv.bv_val = op->o_tmpalloc( bv.bv_len, op->o_tmpmemctx );
ber_init2( ber, &bv, LBER_USE_DER );
ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
/* create new operation */
myop = *op;
- myop.o_bd = NULL;
+ /* FIXME: o_bd needed for ACL */
+ myop.o_bd = op->o_bd;
myop.o_res_ber = ber;
myop.o_callback = NULL;
myop.ors_slimit = 1;