]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Misc tweaks from HEAD
authorKurt Zeilenga <kurt@openldap.org>
Mon, 17 Feb 2003 17:49:37 +0000 (17:49 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 17 Feb 2003 17:49:37 +0000 (17:49 +0000)
configure
libraries/libldap/passwd.c
libraries/libldap_r/tpool.c
servers/slapd/config.c
servers/slapd/slap.h

index 200b94d61c05f91a87c8e6d21ac895c562fa0b8f..32e215fffa7ae42a3774dceab7e0ee883679a2ca 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # $OpenLDAP$
-# from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.30 2003/02/10 19:24:24 kurt Exp  
+# from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.31 2003/02/15 19:17:36 kurt Exp  
 
 # Copyright 1998-2003 The OpenLDAP Foundation.  All Rights Reserved.
 # 
index e8ef6fbf27be24b4348f255cbb72d36edf51b2a2..e228ba8ced28d929cbc3cc384bec0325ea480483 100644 (file)
@@ -20,7 +20,7 @@
 int ldap_parse_passwd(
        LDAP *ld,
        LDAPMessage *res,
-       struct berval **newpasswd )
+       struct berval *newpasswd )
 {
        int rc;
        char *retoid = NULL;
@@ -31,7 +31,8 @@ int ldap_parse_passwd(
        assert( res != NULL );
        assert( newpasswd != NULL );
 
-       *newpasswd = NULL;
+       newpasswd->bv_val = NULL;
+       newpasswd->bv_len = 0;
 
        rc = ldap_parse_extended_result( ld, res, &retoid, &retdata, 0 );
 
@@ -90,17 +91,17 @@ ldap_passwd( LDAP *ld,
                ber_printf( ber, "{" /*}*/ );
 
                if( user != NULL ) {
-                       ber_printf( ber, "ts",
+                       ber_printf( ber, "tO",
                                LDAP_TAG_EXOP_MODIFY_PASSWD_ID, user );
                }
 
                if( oldpw != NULL ) {
-                       ber_printf( ber, "ts",
+                       ber_printf( ber, "tO",
                                LDAP_TAG_EXOP_MODIFY_PASSWD_OLD, oldpw );
                }
 
                if( newpw != NULL ) {
-                       ber_printf( ber, "ts",
+                       ber_printf( ber, "tO",
                                LDAP_TAG_EXOP_MODIFY_PASSWD_NEW, newpw );
                }
 
@@ -129,7 +130,7 @@ ldap_passwd_s(
        struct berval   *user,
        struct berval   *oldpw,
        struct berval   *newpw,
-       struct berval **newpasswd,
+       struct berval *newpasswd,
        LDAPControl **sctrls,
        LDAPControl **cctrls )
 {
index 77aeb22606abd557feb420f10ec881405c8c5d38..aa0eb2d781b909d7d0f7c7ea0f6c504d783c4263 100644 (file)
@@ -214,7 +214,9 @@ ldap_pvt_thread_pool_submit (
        LDAP_STAILQ_INSERT_TAIL(&pool->ltp_pending_list, ctx, ltc_next.q);
        ldap_pvt_thread_cond_signal(&pool->ltp_cond);
        if ((pool->ltp_open_count <= 0
+#if 0
                        || pool->ltp_pending_count > 1
+#endif
                        || pool->ltp_open_count == pool->ltp_active_count)
                && (pool->ltp_max_count <= 0
                        || pool->ltp_open_count < pool->ltp_max_count))
@@ -346,14 +348,8 @@ ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending )
        pool->ltp_state = run_pending
                ? LDAP_INT_THREAD_POOL_FINISHING
                : LDAP_INT_THREAD_POOL_STOPPING;
-       waiting = pool->ltp_open_count;
 
-       /* broadcast could be used here, but only after
-        * it is fixed in the NT thread implementation
-        */
-       while (--waiting >= 0) {
-               ldap_pvt_thread_cond_signal(&pool->ltp_cond);
-       }
+       ldap_pvt_thread_cond_broadcast(&pool->ltp_cond);
        ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex);
 
        do {
@@ -437,7 +433,10 @@ ldap_int_thread_pool_wrapper (
                ctx->ltc_start_routine(ctx, ctx->ltc_arg);
 
                ldap_pvt_thread_mutex_lock(&pool->ltp_mutex);
+               LDAP_SLIST_REMOVE(&pool->ltp_active_list, ctx,
+                       ldap_int_thread_ctx_s, ltc_next.al);
                LDAP_SLIST_INSERT_HEAD(&pool->ltp_free_list, ctx, ltc_next.l);
+               pool->ltp_active_count--;
                ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex);
 
                ldap_pvt_thread_yield();
@@ -447,11 +446,6 @@ ldap_int_thread_pool_wrapper (
                 */
 
                ldap_pvt_thread_mutex_lock(&pool->ltp_mutex);
-               pool->ltp_active_count--;
-               ctx = LDAP_SLIST_FIRST(&pool->ltp_active_list);
-               if (ctx) {
-                       LDAP_SLIST_REMOVE_HEAD(&pool->ltp_active_list, ltc_next.al);
-               }
        }
 
        pool->ltp_open_count--;
index 75a0a43d817430e7cca03008e8af74d00fc17a26..5ac38071fe825d32186bf99c5f21d89f68491202 100644 (file)
@@ -2545,5 +2545,7 @@ config_destroy( )
                free ( slapd_args_file );
        if ( slapd_pid_file )
                free ( slapd_pid_file );
+       if ( default_passwd_hash )
+               free( default_passwd_hash );
        acl_destroy( global_acl, NULL );
 }
index 29b8d6e72311abed8f9346696121d46f206262c1..873eacd4ae4f79c05307dba3fe3acc9a1418dc53 100644 (file)
@@ -74,7 +74,7 @@ LDAP_BEGIN_DECL
 
 #define MAXREMATCHES (100)
 
-#define SLAP_MAX_WORKER_THREADS                (32)
+#define SLAP_MAX_WORKER_THREADS                (16)
 
 #define SLAP_SB_MAX_INCOMING_DEFAULT ((1<<18) - 1)
 #define SLAP_SB_MAX_INCOMING_AUTH ((1<<24) - 1)