static void connection_abandon( Connection *conn );
static void connection_destroy( Connection *c );
+static ldap_pvt_thread_start_t connection_operation;
+
struct co_arg {
Connection *co_conn;
Operation *co_op;
c->c_sasl_bind_mech.bv_len = 0;
c->c_sasl_context = NULL;
c->c_sasl_extra = NULL;
+ c->c_sasl_bindop = NULL;
c->c_sb = ber_sockbuf_alloc( );
assert( c->c_sasl_bind_mech.bv_val == NULL );
assert( c->c_sasl_context == NULL );
assert( c->c_sasl_extra == NULL );
+ assert( c->c_sasl_bindop == NULL );
assert( c->c_currentber == NULL );
ber_str2bv( url, 0, 1, &c->c_listener_url );
#endif /* !SLAPD_MONITOR */
static void *
-connection_operation( void *arg_v )
+connection_operation( void *ctx, void *arg_v )
{
int rc;
struct co_arg *arg = arg_v;
num_ops_initiated++;
ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
+ arg->co_op->o_threadctx = ctx;
+
if( conn->c_sasl_bind_in_progress && tag != LDAP_REQ_BIND ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONNECTION, ERR,
op = slap_op_alloc( ber, msgid, tag, conn->c_n_ops_received++ );
+ op->o_conn = conn;
op->vrFilter = NULL;
-
op->o_pagedresults_state = conn->c_pagedresults_state;
-
#ifdef LDAP_CONNECTIONLESS
op->o_peeraddr = peeraddr;
if (cdn) {
op->o_protocol = LDAP_VERSION2;
}
#endif
+
if ( conn->c_conn_state == SLAP_C_BINDING
|| conn->c_conn_state == SLAP_C_CLOSING )
{
if (!arg->co_op->o_dn.bv_len) {
arg->co_op->o_authz = conn->c_authz;
- arg->co_op->o_dn = conn->c_dn;
- arg->co_op->o_ndn = conn->c_ndn;
+ arg->co_op->o_dn.bv_val = ch_strdup( conn->c_dn.bv_val ?
+ conn->c_dn.bv_val : "" );
+ arg->co_op->o_ndn.bv_val = ch_strdup( conn->c_ndn.bv_val ?
+ conn->c_ndn.bv_val : "" );
}
arg->co_op->o_authtype = conn->c_authtype;
- arg->co_op->o_authmech = conn->c_authmech;
+ ber_dupbv( &arg->co_op->o_authmech, &conn->c_authmech );
if (!arg->co_op->o_protocol) {
arg->co_op->o_protocol = conn->c_protocol