From: Howard Chu Date: Mon, 17 Oct 2005 08:09:28 +0000 (+0000) Subject: Fix noop behavior, don't same TXN twice. Use consistent return code. X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~223 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6e2c36b03da5063e27aafc9535bfb14304d49996;p=openldap Fix noop behavior, don't same TXN twice. Use consistent return code. --- diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 16861df670..f450f630bd 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -378,6 +378,7 @@ retry: /* transaction retry */ rs->sr_text = "txn_abort (no-op) failed"; } else { rs->sr_err = LDAP_NO_OPERATION; + ltid = NULL; goto return_results; } @@ -427,8 +428,8 @@ return_results: if( ltid != NULL ) { TXN_ABORT( ltid ); - op->o_private = NULL; } + op->o_private = NULL; if( postread_ctrl != NULL ) { slap_sl_free( (*postread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx ); diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 5e70633adf..ad6f9eba1b 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -447,6 +447,7 @@ retry: /* transaction retry */ rs->sr_text = "txn_abort (no-op) failed"; } else { rs->sr_err = LDAP_NO_OPERATION; + ltid = NULL; goto return_results; } } else { @@ -502,8 +503,8 @@ return_results: if( ltid != NULL ) { TXN_ABORT( ltid ); - op->o_private = NULL; } + op->o_private = NULL; send_ldap_result( op, rs ); if ( !SLAP_SHADOW( op->o_bd )) diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 00d314e7a5..908da30cc6 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -528,6 +528,7 @@ retry: /* transaction retry */ rs->sr_text = "txn_abort (no-op) failed"; } else { rs->sr_err = LDAP_NO_OPERATION; + ltid = NULL; goto return_results; } } else { @@ -588,8 +589,8 @@ return_results: done: if( ltid != NULL ) { TXN_ABORT( ltid ); - op->o_private = NULL; } + op->o_private = NULL; if( e != NULL ) { bdb_unlocked_cache_return_entry_w (&bdb->bi_cache, e); diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 1bdebe5133..cef5c72a69 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -728,7 +728,8 @@ retry: /* transaction retry */ if(( rs->sr_err=TXN_ABORT( ltid )) != 0 ) { rs->sr_text = "txn_abort (no-op) failed"; } else { - rs->sr_err = LDAP_SUCCESS; + rs->sr_err = LDAP_NO_OPERATION; + ltid = NULL; goto return_results; } @@ -831,8 +832,8 @@ done: if( ltid != NULL ) { TXN_ABORT( ltid ); - op->o_private = NULL; } + op->o_private = NULL; if( preread_ctrl != NULL ) { slap_sl_free( (*preread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );