/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2002-2007 The OpenLDAP Foundation.
+ * Copyright 2002-2012 The OpenLDAP Foundation.
* Portions Copyright 1997,2002-2003 IBM Corporation.
* All rights reserved.
*
#ifdef LDAP_SLAPI
-static struct slap_listener slapi_listener = {
+static struct Listener slapi_listener = {
BER_BVC("slapi://"),
BER_BVC("slapi://")
};
LDAP_STAILQ_INIT( &conn->c_pending_ops );
- op = (Operation *) slapi_ch_calloc( 1, OPERATION_BUFFER_SIZE );
- op->o_hdr = (Opheader *)(op + 1);
- op->o_controls = (void **)(op->o_hdr + 1);
+ op = (Operation *) slapi_ch_calloc( 1, sizeof(OperationBuffer) );
+ op->o_hdr = &((OperationBuffer *) op)->ob_hdr;
+ op->o_controls = ((OperationBuffer *) op)->ob_controls;
op->o_callback = (slap_callback *) slapi_ch_calloc( 1, sizeof(slap_callback) );
op->o_callback->sc_response = slapi_int_response;
/* should check status of thread calls */
ldap_pvt_thread_mutex_init( &conn->c_mutex );
- ldap_pvt_thread_mutex_init( &conn->c_write_mutex );
- ldap_pvt_thread_cond_init( &conn->c_write_cv );
+ ldap_pvt_thread_mutex_init( &conn->c_write1_mutex );
+ ldap_pvt_thread_mutex_init( &conn->c_write2_mutex );
+ ldap_pvt_thread_cond_init( &conn->c_write1_cv );
+ ldap_pvt_thread_cond_init( &conn->c_write2_cv );
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
if ( BER_BVISNULL( &op->o_ndn ) ) {
/* set to root DN */
- be = select_backend( &op->o_req_ndn, get_manageDSAit( op ), 1 );
+ be = select_backend( &op->o_req_ndn, 1 );
if ( be != NULL ) {
ber_dupbv( &op->o_dn, &be->be_rootdn );
ber_dupbv( &op->o_ndn, &be->be_rootndn );
{
SlapReply *rs;
Slapi_Entry *entry_orig = NULL;
+ OpExtraDB oex;
+ int rc;
if ( pb == NULL ) {
return -1;
goto cleanup;
}
- if ( slapi_int_func_internal_pb( pb, op_add ) == 0 ) {
- if ( pb->pb_op->ora_e != NULL && pb->pb_op->o_private != NULL ) {
+ oex.oe.oe_key = (void *)do_add;
+ oex.oe_db = NULL;
+ LDAP_SLIST_INSERT_HEAD(&pb->pb_op->o_extra, &oex.oe, oe_next);
+ rc = slapi_int_func_internal_pb( pb, op_add );
+ LDAP_SLIST_REMOVE(&pb->pb_op->o_extra, &oex.oe, OpExtra, oe_next);
+
+ if ( !rc ) {
+ if ( pb->pb_op->ora_e != NULL && oex.oe_db != NULL ) {
BackendDB *bd = pb->pb_op->o_bd;
- pb->pb_op->o_bd = (BackendDB *)pb->pb_op->o_private;
- pb->pb_op->o_private = NULL;
+ pb->pb_op->o_bd = oex.oe_db;
be_entry_release_w( pb->pb_op, pb->pb_op->ora_e );
pb->pb_op->ora_e = NULL;
pb->pb_op->o_bd = bd;
- pb->pb_op->o_private = NULL;
}
}