]> git.sur5r.net Git - openldap/commitdiff
cleanup
authorKurt Zeilenga <kurt@openldap.org>
Wed, 23 Jun 2004 03:09:13 +0000 (03:09 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 23 Jun 2004 03:09:13 +0000 (03:09 +0000)
servers/slapd/abandon.c
servers/slapd/add.c
servers/slapd/compare.c
servers/slapd/delete.c

index a0cba25f792f4a40a78733ac7026385cfddcfd29..bc37a00f61accd6d85ab6b38f080c090d6e80879 100644 (file)
@@ -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 );
        }
 
index 9b4734ed9cdc5c3a61e5ba9698400432ed4a7729..db2b0743ba93db6ac0d8ed50b2fc490472477be6 100644 (file)
@@ -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 ) {
index 9c483a7a677d71e6e39d8a662e61616d8d4d88a9..a291cfc5e13e5dae3d7d8dbb5ab2050cf9c0698c 100644 (file)
@@ -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;
 }
 
index 70f4cee5e073897d73b8014ae28fefed7ac4cc07..7bc2f42ed7423da70bd17eb2a79579432d0f053c 100644 (file)
@@ -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 );