From: Kurt Zeilenga Date: Mon, 17 Feb 2003 17:49:37 +0000 (+0000) Subject: Misc tweaks from HEAD X-Git-Tag: OPENLDAP_REL_ENG_2_1_13~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f2aa5ece4b8952a5600c05b60bea6a011262816;p=thirdparty%2Fopenldap.git Misc tweaks from HEAD --- diff --git a/configure b/configure index 200b94d61c..32e215fffa 100755 --- 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. # diff --git a/libraries/libldap/passwd.c b/libraries/libldap/passwd.c index e8ef6fbf27..e228ba8ced 100644 --- a/libraries/libldap/passwd.c +++ b/libraries/libldap/passwd.c @@ -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 ) { diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index 77aeb22606..aa0eb2d781 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -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--; diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 75a0a43d81..5ac38071fe 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -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 ); } diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 29b8d6e723..873eacd4ae 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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)