X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fresult.c;h=04490d3b7274205cc968d2c98d6a76745b74de6d;hb=5d64cae0fe2ed5c88fedb3082388e21b26d123c5;hp=a710e1910f98812e128d928e40764821b69da1a9;hpb=3952bc8e95a2b21aced14f890028f12d00e191fa;p=openldap diff --git a/servers/slapd/result.c b/servers/slapd/result.c index a710e1910f..04490d3b72 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -113,13 +113,13 @@ send_ldap_result2( active_threads--; conn->c_writewaiter = 1; -#ifdef HAVE_LINUX_THREADS - pthread_kill( listener_tid, SIGSTKFLT ); -#else /* !linux */ - pthread_kill( listener_tid, SIGUSR1 ); -#endif /* !linux */ + pthread_kill( listener_tid, LDAP_SIGUSR1 ); pthread_cond_wait( &conn->c_wcv, &active_threads_mutex ); + + if( active_threads < 1 ) { + pthread_cond_signal(&active_threads_cond); + } pthread_mutex_unlock( &active_threads_mutex ); pthread_yield(); @@ -200,7 +200,7 @@ send_search_entry( return( 1 ); } - edn = dn_normalize_case( strdup( e->e_dn ) ); + edn = dn_normalize_case( ch_strdup( e->e_dn ) ); #ifdef LDAP_COMPAT30 if ( (ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER )) @@ -348,8 +348,12 @@ send_search_entry( pthread_mutex_lock( &active_threads_mutex ); active_threads--; conn->c_writewaiter = 1; - pthread_kill( listener_tid, SIGUSR1 ); + pthread_kill( listener_tid, LDAP_SIGUSR1 ); pthread_cond_wait( &conn->c_wcv, &active_threads_mutex ); + + if( active_threads < 1 ) { + pthread_cond_signal(&active_threads_cond); + } pthread_mutex_unlock( &active_threads_mutex ); pthread_yield();