From: Kurt Zeilenga Date: Wed, 23 Jun 2004 03:09:13 +0000 (+0000) Subject: cleanup X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~185 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ee7dfb2ab91d06f0dafe8a04910244db1279884a;p=openldap cleanup --- diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index a0cba25f79..bc37a00f61 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -101,7 +101,8 @@ do_abandon( Operation *op, SlapReply *rs ) LDAP_STAILQ_FOREACH( o, &op->o_conn->c_pending_ops, o_next ) { if ( o->o_msgid == id ) { - LDAP_STAILQ_REMOVE( &op->o_conn->c_pending_ops, o, slap_op, o_next ); + LDAP_STAILQ_REMOVE( &op->o_conn->c_pending_ops, + o, slap_op, o_next ); op->o_conn->c_n_ops_pending--; slap_op_free( o ); goto done; @@ -109,11 +110,9 @@ do_abandon( Operation *op, SlapReply *rs ) } done: - op->orn_msgid = id; for ( i = 0; i < nbackends; i++ ) { op->o_bd = &backends[i]; - if( op->o_bd->be_abandon ) op->o_bd->be_abandon( op, rs ); } diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 9b4734ed9c..db2b0743ba 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -125,7 +125,7 @@ do_add( Operation *op, SlapReply *rs ) if ( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ERR, - "do_add: conn %d decoding error \n", op->o_connid, 0, 0 ); + "do_add: conn %d decoding error \n", op->o_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_add: decoding error\n", 0, 0, 0 ); #endif @@ -383,7 +383,6 @@ do_add( Operation *op, SlapReply *rs ) #endif /* LDAP_SLAPI */ done: - slap_graduate_commit_csn( op ); if( modlist != NULL ) { diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index 9c483a7a67..a291cfc5e1 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -43,8 +43,7 @@ static int compare_entry( int do_compare( Operation *op, - SlapReply *rs -) + SlapReply *rs ) { Entry *entry = NULL; struct berval dn = BER_BVNULL; @@ -115,7 +114,8 @@ do_compare( goto cleanup; } - rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx ); + rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, + op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, INFO, @@ -148,10 +148,13 @@ do_compare( #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ARGS, "do_compare: dn (%s) attr(%s) value (%s)\n", - op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); + op->o_req_dn.bv_val, + ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); #else - Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n", - op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); + Debug( LDAP_DEBUG_ARGS, + "do_compare: dn (%s) attr (%s) value (%s)\n", + op->o_req_dn.bv_val, + ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); #endif Statslog( LDAP_DEBUG_STATS, @@ -174,11 +177,12 @@ do_compare( #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ARGS, "do_compare: dn (%s) attr(%s) value (%s)\n", - op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, - ava.aa_value.bv_val ); + op->o_req_dn.bv_val, + ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); #else Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n", - op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); + op->o_req_dn.bv_val, + ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); #endif Statslog( LDAP_DEBUG_STATS, @@ -206,8 +210,10 @@ do_compare( send_ldap_result( op, rs ); - if( rs->sr_err == LDAP_COMPARE_TRUE || rs->sr_err == LDAP_COMPARE_FALSE ) { - rs->sr_err = 0; + if( rs->sr_err == LDAP_COMPARE_TRUE || + rs->sr_err == LDAP_COMPARE_FALSE ) + { + rs->sr_err = LDAP_SUCCESS; } goto cleanup; @@ -220,7 +226,8 @@ do_compare( * appropriate one, or send a referral to our "referral server" * if we don't hold it. */ - if ( (op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 )) == NULL ) { + op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 ); + if ( op->o_bd == NULL ) { rs->sr_ref = referral_rewrite( default_referral, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT ); @@ -247,10 +254,12 @@ do_compare( #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ARGS, "do_compare: dn (%s) attr(%s) value (%s)\n", - op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); + op->o_req_dn.bv_val, + ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); #else Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n", - op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); + op->o_req_dn.bv_val, + ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); #endif Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n", @@ -266,21 +275,25 @@ do_compare( slapi_pblock_set( pb, SLAPI_COMPARE_TYPE, (void *)desc.bv_val ); slapi_pblock_set( pb, SLAPI_COMPARE_VALUE, (void *)&value ); - rs->sr_err = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_COMPARE_FN, pb ); + rs->sr_err = slapi_int_call_plugins( op->o_bd, + SLAPI_PLUGIN_PRE_COMPARE_FN, pb ); if ( rs->sr_err < 0 ) { /* * A preoperation plugin failure will abort the * entire operation. */ #ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_compare: compare preoperation plugin " - "failed\n", 0, 0, 0); + LDAP_LOG( OPERATION, INFO, + "do_compare: compare preoperation plugin failed\n", + 0, 0, 0); #else - Debug(LDAP_DEBUG_TRACE, "do_compare: compare preoperation plugin " - "failed.\n", 0, 0, 0); + Debug(LDAP_DEBUG_TRACE, + "do_compare: compare preoperation plugin failed\n", + 0, 0, 0); #endif - if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 ) || - rs->sr_err == LDAP_SUCCESS ) { + if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, + (void *)&rs->sr_err ) != 0 ) || rs->sr_err == LDAP_SUCCESS ) + { rs->sr_err = LDAP_OTHER; } goto cleanup; @@ -297,13 +310,15 @@ do_compare( } #if defined( LDAP_SLAPI ) - if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_COMPARE_FN, pb ) < 0 ) { + if ( pb != NULL && slapi_int_call_plugins( op->o_bd, + SLAPI_PLUGIN_POST_COMPARE_FN, pb ) < 0 ) + { #ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_compare: compare postoperation plugins " - "failed\n", 0, 0, 0 ); + LDAP_LOG( OPERATION, INFO, + "do_compare: compare postoperation plugins failed\n", 0, 0, 0 ); #else - Debug(LDAP_DEBUG_TRACE, "do_compare: compare postoperation plugins " - "failed.\n", 0, 0, 0); + Debug(LDAP_DEBUG_TRACE, + "do_compare: compare postoperation plugins failed\n", 0, 0, 0 ); #endif } #endif /* defined( LDAP_SLAPI ) */ @@ -311,8 +326,9 @@ do_compare( cleanup: op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx ); op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx ); - if ( ava.aa_value.bv_val ) op->o_tmpfree( ava.aa_value.bv_val, op->o_tmpmemctx ); - + if ( ava.aa_value.bv_val ) { + op->o_tmpfree( ava.aa_value.bv_val, op->o_tmpmemctx ); + } return rs->sr_err; } diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 70f4cee5e0..7bc2f42ed7 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -42,8 +42,7 @@ int do_delete( Operation *op, - SlapReply *rs -) + SlapReply *rs ) { struct berval dn = BER_BVNULL; struct berval pdn = BER_BVNULL; @@ -88,7 +87,8 @@ do_delete( goto cleanup; } - rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx ); + rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, + op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, INFO, @@ -175,21 +175,24 @@ do_delete( slapi_pblock_set( pb, SLAPI_DELETE_TARGET, (void *)dn.bv_val ); slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit ); - rs->sr_err = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_DELETE_FN, pb ); + rs->sr_err = slapi_int_call_plugins( op->o_bd, + SLAPI_PLUGIN_PRE_DELETE_FN, pb ); if ( rs->sr_err < 0 ) { /* * A preoperation plugin failure will abort the * entire operation. */ #ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_delete: delete preoperation plugin " - "failed\n", 0, 0, 0 ); + LDAP_LOG( OPERATION, INFO, "do_delete: " + "delete preoperation plugin failed\n", 0, 0, 0 ); #else - Debug (LDAP_DEBUG_TRACE, "do_delete: delete preoperation plugin failed.\n", - 0, 0, 0); + Debug (LDAP_DEBUG_TRACE, "do_delete: " + "delete preoperation plugin failed.\n", 0, 0, 0); #endif - if ( ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 ) || - rs->sr_err == LDAP_SUCCESS ) { + if ( ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, + (void *)&rs->sr_err ) != 0 ) || + rs->sr_err == LDAP_SUCCESS ) + { rs->sr_err = LDAP_OTHER; } goto cleanup; @@ -289,19 +292,22 @@ do_delete( } #if defined( LDAP_SLAPI ) - if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_DELETE_FN, pb ) < 0) { + if ( pb != NULL && slapi_int_call_plugins( op->o_bd, + SLAPI_PLUGIN_POST_DELETE_FN, pb ) < 0) + { #ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_delete: delete postoperation plugins " - "failed\n", 0, 0, 0 ); + LDAP_LOG( OPERATION, INFO, + "do_delete: delete postoperation plugins failed\n", + 0, 0, 0 ); #else - Debug(LDAP_DEBUG_TRACE, "do_delete: delete postoperation plugins " - "failed.\n", 0, 0, 0); + Debug(LDAP_DEBUG_TRACE, + "do_delete: delete postoperation plugins failed\n", + 0, 0, 0 ); #endif } #endif /* defined( LDAP_SLAPI ) */ cleanup: - slap_graduate_commit_csn( op ); op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );