From 815c178edc185cc02aeef54ac9f21679bc463bbd Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 7 Mar 2006 22:05:57 +0000 Subject: [PATCH] control/TXN cleanup --- servers/slapd/back-bdb/add.c | 2 ++ servers/slapd/back-bdb/delete.c | 2 ++ servers/slapd/back-bdb/modify.c | 2 ++ servers/slapd/back-bdb/modrdn.c | 2 ++ servers/slapd/backend.c | 8 ++++++-- servers/slapd/controls.c | 2 ++ 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 3377541de7..3cafbe42cb 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -47,6 +47,7 @@ bdb_add(Operation *op, SlapReply *rs ) Debug(LDAP_DEBUG_ARGS, "==> " LDAP_XSTRING(bdb_add) ": %s\n", op->oq_add.rs_e->e_name.bv_val, 0, 0); +#ifdef LDAP_X_TXN if( op->o_txnSpec ) { /* acquire connection lock */ ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex ); @@ -76,6 +77,7 @@ txnReturn: send_ldap_result( op, rs ); return rs->sr_err; } +#endif ctrls[num_ctrls] = 0; diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 7ecf66e03a..60fa54f9a1 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -55,6 +55,7 @@ bdb_delete( Operation *op, SlapReply *rs ) Debug( LDAP_DEBUG_ARGS, "==> " LDAP_XSTRING(bdb_delete) ": %s\n", op->o_req_dn.bv_val, 0, 0 ); +#ifdef LDAP_X_TXN if( op->o_txnSpec ) { /* acquire connection lock */ ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex ); @@ -84,6 +85,7 @@ txnReturn: send_ldap_result( op, rs ); return rs->sr_err; } +#endif ctrls[num_ctrls] = 0; diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 60697881a8..7ad798b480 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -296,6 +296,7 @@ bdb_modify( Operation *op, SlapReply *rs ) Debug( LDAP_DEBUG_ARGS, LDAP_XSTRING(bdb_modify) ": %s\n", op->o_req_dn.bv_val, 0, 0 ); +#ifdef LDAP_X_TXN if( op->o_txnSpec ) { /* acquire connection lock */ ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex ); @@ -325,6 +326,7 @@ txnReturn: send_ldap_result( op, rs ); return rs->sr_err; } +#endif ctrls[num_ctrls] = NULL; diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 23b42a19e6..23d28810af 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -65,6 +65,7 @@ bdb_modrdn( Operation *op, SlapReply *rs ) op->o_req_dn.bv_val,op->oq_modrdn.rs_newrdn.bv_val, op->oq_modrdn.rs_newSup ? op->oq_modrdn.rs_newSup->bv_val : "NULL" ); +#ifdef LDAP_X_TXN if( op->o_txnSpec ) { /* acquire connection lock */ ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex ); @@ -94,6 +95,7 @@ txnReturn: send_ldap_result( op, rs ); return rs->sr_err; } +#endif ctrls[num_ctrls] = NULL; diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 3256dd05f0..eeb2b5dd9a 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -818,10 +818,14 @@ backend_check_controls( /* unrecognized control */ if ( (*ctrls)->ldctl_iscritical ) { /* should not be reachable */ - Debug( LDAP_DEBUG_ANY, - "backend_check_controls: unrecognized control: %s\n", + Debug( LDAP_DEBUG_ANY, "backend_check_controls: " + "unrecognized critical control: %s\n", (*ctrls)->ldctl_oid, 0, 0 ); assert( 0 ); + } else { + Debug( LDAP_DEBUG_TRACE, "backend_check_controls: " + "unrecognized non-critical control: %s\n", + (*ctrls)->ldctl_oid, 0, 0 ); } break; diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 5d9d73f412..4592ee2aae 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -492,9 +492,11 @@ slap_global_control( Operation *op, const char *oid, int *cid ) return LDAP_COMPARE_TRUE; } +#if 0 Debug( LDAP_DEBUG_TRACE, "slap_global_control: unavailable control: %s\n", oid, 0, 0 ); +#endif return LDAP_COMPARE_FALSE; }