]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/result.c
Use a separate mutex for the replication timestamp
[openldap] / servers / slapd / result.c
index ad379390e57c940b4b3650c1caaae91363db3eff..b3971d5284a3e8f5c136a657ca8aa217aa0bb235 100644 (file)
@@ -248,7 +248,7 @@ send_ldap_controls( Operation *o, BerElement *ber, LDAPControl **c )
         * plugin.
         */
 
-       if ( slapi_pblock_get( o->o_pb, SLAPI_RESCONTROLS, &sctrls ) != 0 ) {
+       if ( o->o_pb && slapi_pblock_get( o->o_pb, SLAPI_RESCONTROLS, &sctrls ) != 0 ) {
                sctrls = NULL;
        }
 
@@ -289,11 +289,12 @@ send_ldap_response(
 {
        BerElementBuffer berbuf;
        BerElement      *ber = (BerElement *) &berbuf;
-       int             rc;
+       int             rc = LDAP_SUCCESS;
        long    bytes;
 
        if (op->o_callback) {
                slap_callback *sc = op->o_callback;
+               rc = SLAP_CB_CONTINUE;
                for ( ; op->o_callback; ) {
                        if ( op->o_callback->sc_response ) {
                                rc = op->o_callback->sc_response( op, rs );
@@ -304,7 +305,7 @@ send_ldap_response(
                op->o_callback = sc;
                if ( rc != SLAP_CB_CONTINUE ) goto cleanup;
        }
-               
+
 #ifdef LDAP_CONNECTIONLESS
        if (op->o_conn && op->o_conn->c_is_udp)
                ber = op->o_res_ber;
@@ -585,7 +586,7 @@ slap_send_ldap_result( Operation *op, SlapReply *rs )
         * result if they wish to change the result.
         */
        if ( op->o_pb ) {
-               slapi_x_pblock_set_operation( op->o_pb, op );
+               slapi_int_pblock_set_operation( op->o_pb, op );
                slapi_pblock_set( op->o_pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
                slapi_pblock_set( op->o_pb, SLAPI_RESULT_TEXT, (void *)rs->sr_text );
                slapi_pblock_set( op->o_pb, SLAPI_RESULT_MATCHED, (void *)rs->sr_matched );
@@ -719,6 +720,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
        rs->sr_type = REP_SEARCH;
        if (op->o_callback) {
                slap_callback *sc = op->o_callback;
+               rc = SLAP_CB_CONTINUE;
                for ( ; op->o_callback; ) {
                        if ( op->o_callback->sc_response ) {
                                rc = op->o_callback->sc_response( op, rs );
@@ -1181,7 +1183,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
                if ( rs->sr_attrs != NULL ) {
                        for ( anp = rs->sr_attrs; anp->an_name.bv_val != NULL; anp++ ) {
                                rc = compute_evaluator( &ctx, anp->an_name.bv_val,
-                                       rs->sr_entry, slapi_x_compute_output_ber );
+                                       rs->sr_entry, slapi_int_compute_output_ber );
                                if ( rc == 1 ) {
                                        break;
                                }
@@ -1193,7 +1195,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
                         * plugin decide whether to be naughty or not.
                         */
                        rc = compute_evaluator( &ctx, "*",
-                               rs->sr_entry, slapi_x_compute_output_ber );
+                               rs->sr_entry, slapi_int_compute_output_ber );
                }
                if ( rc == 1 ) {
                        if ( op->o_res_ber == NULL ) ber_free_buf( ber );
@@ -1327,6 +1329,7 @@ slap_send_search_reference( Operation *op, SlapReply *rs )
        rs->sr_type = REP_SEARCHREF;
        if (op->o_callback) {
                slap_callback *sc = op->o_callback;
+               rc = SLAP_CB_CONTINUE;
                for ( ; op->o_callback; ) {
                        if ( op->o_callback->sc_response ) {
                                rc = op->o_callback->sc_response( op, rs );