]> git.sur5r.net Git - openldap/commitdiff
Additional changes - these suggested by Quanah
authorKurt Zeilenga <kurt@openldap.org>
Wed, 5 Apr 2006 20:26:36 +0000 (20:26 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 5 Apr 2006 20:26:36 +0000 (20:26 +0000)
servers/slapd/ad.c
servers/slapd/overlays/syncprov.c

index 7183d5e59fb6f3d5efac1b6e7987d470150f4092..4ac9b6a8c042768c66d4632825fa8605ba45d021 100644 (file)
@@ -1177,11 +1177,13 @@ ad_define_option( const char *name, const char *fname, int lineno )
        return 0;
 }
 
-void ad_unparse_options( BerVarray *res ){
+void
+ad_unparse_options( BerVarray *res )
+{
        int i;
-    for ( i=0; i < option_count; i++ ) {
-       ber_bvarray_add( res, ber_bvdup( &(options[i].name) ));
-    }
+       for ( i = 0; i < option_count; i++ ) {
+               value_add_one( res, &options[i].name );
+       }
 }
 
 /* Find the definition of the option name or prefix matching the arguments */
index ae7780700fcbbf714d764aed2768585a2f62e68b..2278ad34ebd284b1e4cce696d0aea16b80313fd9 100644 (file)
@@ -1302,9 +1302,6 @@ syncprov_add_slog( Operation *op, struct berval *csn )
                        sl->sl_mincsn.bv_len = se->se_csn.bv_len;
                        ch_free( se );
                        sl->sl_num--;
-                       if ( !sl->sl_head ) {
-                               sl->sl_tail = NULL;
-                       }
                }
                ldap_pvt_thread_mutex_unlock( &sl->sl_mutex );
        }
@@ -1784,6 +1781,9 @@ syncprov_detach_op( Operation *op, syncops *so, slap_overinst *on )
        LDAP_STAILQ_INSERT_TAIL( &op->o_conn->c_ops, op2, o_next );
        so->s_flags |= PS_IS_DETACHED;
        ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
+
+       /* Prevent anyone else from trying to send a result for this op */
+       op->o_abandon = 1;
 }
 
 static int
@@ -1902,10 +1902,12 @@ syncprov_op_search( Operation *op, SlapReply *rs )
                /* syncprov_findbase expects to be called as a callback... */
                sc.sc_private = &opc;
                opc.son = on;
+               ldap_pvt_thread_mutex_init( &so.s_mutex );
                cb = op->o_callback;
                op->o_callback = &sc;
                rs->sr_err = syncprov_findbase( op, &fc );
                op->o_callback = cb;
+               ldap_pvt_thread_mutex_destroy( &so.s_mutex );
 
                if ( rs->sr_err != LDAP_SUCCESS ) {
                        send_ldap_result( op, rs );