From 8138094165e0dc2a2a9d50cab0f94fd3dc8afd0c Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 16 Jan 2006 20:06:12 +0000 Subject: [PATCH] Updates from HEAD --- CHANGES | 6 ++++++ INSTALL | 2 +- configure.in | 12 ++++++------ doc/devel/todo | 1 - libraries/libldap/getdn.c | 12 ++++++------ libraries/libldap/test.c | 2 +- libraries/libldap_r/tpool.c | 26 +++++++++----------------- 7 files changed, 29 insertions(+), 32 deletions(-) diff --git a/CHANGES b/CHANGES index c172810834..0e866b4d2c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ OpenLDAP 2.3 Change Log OpenLDAP 2.3.18 Engineering + Fixed slapd wake_listener + Removed slapd-bdb/hdb extraneous yields (ITS#3950) + Build Environment + Removed problematic Linux sched_yield(2) workarounds (ITS#3950) + Documentation + Updated release documents OpenLDAP 2.3.17 Release Fixed slapd anonymous proxy authorization issue (ITS#4320) diff --git a/INSTALL b/INSTALL index 68c0c86006..e1949d1f7a 100644 --- a/INSTALL +++ b/INSTALL @@ -74,7 +74,7 @@ Making and Installing the OpenLDAP Distribution 6. Test the standalone system: This step requires the standalone LDAP server, slapd(8), with - BDB, HDB, and/or LDBM support. + BDB or HDB support. % make test diff --git a/configure.in b/configure.in index 8343d6cc00..47dfca4bfa 100644 --- a/configure.in +++ b/configure.in @@ -1587,12 +1587,12 @@ dnl [ol_cv_pthread_lpthread_lexc]) fi ol_replace_broken_yield=no - case "$target" in - *-*-linux*) - AC_CHECK_FUNCS(nanosleep) - ol_replace_broken_yield=yes - ;; - esac +dnl case "$target" in +dnl *-*-linux*) +dnl AC_CHECK_FUNCS(nanosleep) +dnl ol_replace_broken_yield=yes +dnl ;; +dnl esac if test $ol_replace_broken_yield = yes ; then AC_DEFINE([REPLACE_BROKEN_YIELD],1, diff --git a/doc/devel/todo b/doc/devel/todo index 97e31ff3da..56610870c0 100644 --- a/doc/devel/todo +++ b/doc/devel/todo @@ -56,7 +56,6 @@ Implement SASLprep (RFC 4013) for LDAP (draft-ietf-ldapbis-*) Implement additional matching rules (RFC 3698) Add dumpasn1 logging support Add tests to test suite -Add jail(2) support Recode linked-list structs to use macros Convert utfconv.txt into man page(s). Update manual pages as needed. diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index e93fc465b1..389dd0a03c 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -708,7 +708,7 @@ ldap_bv2dn_x( struct berval *bvin, LDAPDN *dn, unsigned flags, void *ctx ) str = bv->bv_val; end = str + bv->bv_len; - Debug( LDAP_DEBUG_TRACE, "=> ldap_bv2dn(%s,%u)\n", str, flags, 0 ); + Debug( LDAP_DEBUG_ARGS, "=> ldap_bv2dn(%s,%u)\n", str, flags, 0 ); *dn = NULL; @@ -890,8 +890,8 @@ return_result:; LDAP_FREEX( tmpDN, ctx ); } - Debug( LDAP_DEBUG_TRACE, "<= ldap_bv2dn(%s)=%d %s\n", str, rc, - ldap_err2string( rc ) ); + Debug( LDAP_DEBUG_ARGS, "<= ldap_bv2dn(%s)=%d %s\n", str, rc, + rc ? ldap_err2string( rc ) : "" ); *dn = newDN; return( rc ); @@ -3001,7 +3001,7 @@ int ldap_dn2bv_x( LDAPDN dn, struct berval *bv, unsigned flags, void *ctx ) bv->bv_len = 0; bv->bv_val = NULL; - Debug( LDAP_DEBUG_TRACE, "=> ldap_dn2bv(%u)\n", flags, 0, 0 ); + Debug( LDAP_DEBUG_ARGS, "=> ldap_dn2bv(%u)\n", flags, 0, 0 ); /* * a null dn means an empty dn string @@ -3310,8 +3310,8 @@ int ldap_dn2bv_x( LDAPDN dn, struct berval *bv, unsigned flags, void *ctx ) return LDAP_PARAM_ERROR; } - Debug( LDAP_DEBUG_TRACE, "<= ldap_dn2bv(%s)=%d %s\n", - bv->bv_val, rc, ldap_err2string( rc ) ); + Debug( LDAP_DEBUG_ARGS, "<= ldap_dn2bv(%s)=%d %s\n", + bv->bv_val, rc, rc ? ldap_err2string( rc ) : "" ); return_results:; return( rc ); diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index 97a7732fb9..1affb1c714 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -169,7 +169,7 @@ get_modlist( { static char buf[256]; int num; - LDAPMod tmp; + LDAPMod tmp = { 0 }; LDAPMod **result; struct berval **bvals; diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index 2d313f7396..355543cd3e 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -379,14 +379,7 @@ ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending ) : LDAP_INT_THREAD_POOL_STOPPING; ldap_pvt_thread_cond_broadcast(&pool->ltp_cond); - ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); - - do { - ldap_pvt_thread_yield(); - ldap_pvt_thread_mutex_lock(&pool->ltp_mutex); - waiting = pool->ltp_open_count; - ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); - } while (waiting > 0); + ldap_pvt_thread_cond_wait(&pool->ltp_cond, &pool->ltp_mutex); while ((ctx = LDAP_STAILQ_FIRST(&pool->ltp_pending_list)) != NULL) { @@ -461,6 +454,9 @@ ldap_int_thread_pool_wrapper ( * should be like this: * if (pool->ltp_open_count > 1 && pool->ltp_starting == 0) * check timer, leave thread (break;) + * + * Just use pthread_cond_timedwait if we want to + * check idle time. */ if (pool->ltp_state == LDAP_INT_THREAD_POOL_RUNNING @@ -492,15 +488,6 @@ ldap_int_thread_pool_wrapper ( } ldap_pvt_thread_cond_wait(&pool->ltp_cond, &pool->ltp_mutex); } - ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); - - ldap_pvt_thread_yield(); - - /* if we use an idle timer, here's - * a good place to update it - */ - - ldap_pvt_thread_mutex_lock(&pool->ltp_mutex); } for ( i=0; iltp_open_count--; + + /* let pool_destroy know we're all done */ + if (pool->ltp_open_count < 1) + ldap_pvt_thread_cond_signal(&pool->ltp_cond); + ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); ldap_pvt_thread_exit(NULL); -- 2.39.5