connection_fake_init2( conn, opbuf, ctx, 1 );
}
+void
+operation_fake_init(
+ Connection *conn,
+ Operation *op,
+ void *ctx,
+ int newmem )
+{
+ /* set memory context */
+ op->o_tmpmemctx = slap_sl_mem_create(SLAP_SLAB_SIZE, SLAP_SLAB_STACK, ctx,
+ newmem );
+ op->o_tmpmfuncs = &slap_sl_mfuncs;
+ op->o_threadctx = ctx;
+ op->o_tid = ldap_pvt_thread_pool_tid( ctx );
+
+ op->o_counters = &slap_counters;
+ op->o_conn = conn;
+ op->o_connid = op->o_conn->c_connid;
+ connection_init_log_prefix( op );
+}
+
+
void
connection_fake_init2(
Connection *conn,
op->o_hdr = &opbuf->ob_hdr;
op->o_controls = opbuf->ob_controls;
- /* set memory context */
- op->o_tmpmemctx = slap_sl_mem_create(SLAP_SLAB_SIZE, SLAP_SLAB_STACK, ctx,
- newmem );
- op->o_tmpmfuncs = &slap_sl_mfuncs;
- op->o_threadctx = ctx;
- op->o_tid = ldap_pvt_thread_pool_tid( ctx );
-
- op->o_counters = &slap_counters;
- op->o_conn = conn;
- op->o_connid = op->o_conn->c_connid;
- connection_init_log_prefix( op );
+ operation_fake_init( conn, op, ctx, newmem );
#ifdef LDAP_SLAPI
if ( slapi_plugins_used ) {
unsigned ulen)
{
Operation op = {0};
+ Opheader oph;
SlapReply rs = {REP_RESULT};
int rc, i, j;
Connection *conn = NULL;
&text, textbuf, textlen );
if ( rc == LDAP_SUCCESS ) {
- op.o_hdr = conn->c_sasl_bindop->o_hdr;
+ if ( conn->c_sasl_bindop ) {
+ op.o_hdr = conn->c_sasl_bindop->o_hdr;
+ } else {
+ op.o_hdr = &oph;
+ memset( &oph, 0, sizeof(oph) );
+ operation_fake_init( conn, &op, ldap_pvt_thread_pool_context(), 0 );
+ }
op.o_tag = LDAP_REQ_MODIFY;
op.o_ndn = op.o_req_ndn;
op.o_callback = &cb;