OpenLDAP Change Log
+Changes included in OpenLDAP Stable
+ CVS Tag: OPENLDAP_STABLE
+ Fixed DCE Threading issues
+
Changes included in OpenLDAP Stable
CVS Tag: OPENLDAP_STABLE_981105
Updated manual pages.
Fixed libldif/line64 bug
+ Fixed slapd/back-passwd sizelimit bug
+ Fixed slapd/filterentry equality bug
Changes included in OpenLDAP Stable
CVS Tag: OPENLDAP_STABLE_981027
pthread_attr_init( &attr );
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
+#if !defined( THREAD_MIT_PTHREADS ) && !defined( THREAD_DCE_PTHREADS )
+ /* POSIX_THREADS or compatible
+ * This is a draft 10 or standard pthreads implementation
+ */
+ if ( pthread_create( &arg->co_op->o_tid, &attr,
+ (void *) connection_operation, (void *) arg ) != 0 ) {
+ Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
+ } else {
+ pthread_mutex_lock( &active_threads_mutex );
+ active_threads++;
+ pthread_mutex_unlock( &active_threads_mutex );
+ }
+#else /* draft 4 */
+ /*
+ * This is a draft 4 or earlier pthreads implementation
+ */
if ( pthread_create( &arg->co_op->o_tid, attr,
(void *) connection_operation, (void *) arg ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
active_threads++;
pthread_mutex_unlock( &active_threads_mutex );
}
+#endif /* draft 4 */
pthread_attr_destroy( &attr );
}
#include "slap.h"
#include "ldapconfig.h"
-extern void daemon();
+extern void slapd_daemon();
extern int lber_debug;
extern char Versionstr[];
+
/*
* read-only global variables or variables only written by the listener
* thread (after they are initialized) - no need to protect them with a mutex.
*/
-int ldap_debug;
+int ldap_debug = 0;
#ifdef LDAP_DEBUG
int ldap_syslog = LDAP_DEBUG_STATS;
#else
*/
pthread_mutex_t entry2str_mutex;
pthread_mutex_t replog_mutex;
-#ifndef sunos5
-pthread_mutex_t regex_mutex;
-#endif
static
usage( name )
char *name;
{
- fprintf( stderr, "usage: %s [-d debuglevel] [-f configfile] [-p portnumber] [-s sysloglevel]\n", name );
+ fprintf( stderr, "usage: %s [-d ?|debuglevel] [-f configfile] [-p portnumber] [-s sysloglevel]\n", name );
}
main( argc, argv )
LDAP_DEBUG_CONFIG );
printf( "\tLDAP_DEBUG_ACL\t\t%d\n",
LDAP_DEBUG_ACL );
- printf( "\tLDAP_DEBUG_STATS\t\t%d\n",
+ printf( "\tLDAP_DEBUG_STATS\t%d\n",
LDAP_DEBUG_STATS );
- printf( "\tLDAP_DEBUG_STATS2\t\t%d\n",
+ printf( "\tLDAP_DEBUG_STATS2\t%d\n",
LDAP_DEBUG_STATS2 );
- printf( "\tLDAP_DEBUG_SHELL\t\t%d\n",
+ printf( "\tLDAP_DEBUG_SHELL\t%d\n",
LDAP_DEBUG_SHELL );
- printf( "\tLDAP_DEBUG_PARSE\t\t%d\n",
+ printf( "\tLDAP_DEBUG_PARSE\t%d\n",
LDAP_DEBUG_PARSE );
printf( "\tLDAP_DEBUG_ANY\t\t%d\n",
LDAP_DEBUG_ANY );
exit( 0 );
} else {
- ldap_debug = atoi( optarg );
+ ldap_debug |= atoi( optarg );
lber_debug = (ldap_debug & LDAP_DEBUG_BER);
}
break;
pthread_attr_init( &attr );
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
- if ( pthread_create( &listener_tid, attr, (void *) daemon,
+#if !defined( THREAD_MIT_PTHREADS ) && !defined( THREAD_DCE_PTHREADS )
+ /* POSIX_THREADS or compatible
+ * This is a draft 10 or standard pthreads implementation
+ */
+ if ( pthread_create( &listener_tid, &attr, (void *) slapd_daemon,
+ (void *) port ) != 0 ) {
+ Debug( LDAP_DEBUG_ANY,
+ "listener pthread_create failed\n", 0, 0, 0 );
+ exit( 1 );
+ }
+#else /* draft 4 */
+ /*
+ * This is a draft 4 or earlier pthreads implementation
+ */
+ if ( pthread_create( &listener_tid, attr, (void *) slapd_daemon,
(void *) port ) != 0 ) {
Debug( LDAP_DEBUG_ANY,
"listener pthread_create failed\n", 0, 0, 0 );
exit( 1 );
}
+#endif /* draft 4 */
pthread_attr_destroy( &attr );
pthread_join( listener_tid, (void *) &status );
pthread_exit( 0 );
* Start the main file manager thread (in fm.c).
*/
pthread_attr_init( &attr );
+#if !defined( THREAD_MIT_PTHREADS ) && !defined( THREAD_DCE_PTHREADS )
+ /* POSIX_THREADS or compatible
+ * This is a draft 10 or standard pthreads implementation
+ */
+ if ( pthread_create( &(sglob->fm_tid), &attr, (void *) fm, (void *) NULL )
+ != 0 ) {
+ Debug( LDAP_DEBUG_ANY, "file manager pthread_create failed\n",
+ 0, 0, 0 );
+ exit( 1 );
+
+ }
+#else /* draft 4 */
+ /*
+ * This is a draft 4 or earlier pthreads implementation
+ */
if ( pthread_create( &(sglob->fm_tid), attr, (void *) fm, (void *) NULL )
!= 0 ) {
Debug( LDAP_DEBUG_ANY, "file manager pthread_create failed\n",
exit( 1 );
}
+#endif /* draft 4 */
pthread_attr_destroy( &attr );
/*
* Wait for the fm thread to finish.
*/
+#ifdef POSIX_THREADS
+ pthread_join( sglob->fm_tid, (void *) NULL );
+#else
pthread_join( sglob->fm_tid, (void *) &status );
+#endif
/*
* Wait for the replica threads to finish.
*/
for ( i = 0; sglob->replicas[ i ] != NULL; i++ ) {
+#ifdef POSIX_THREADS
+ pthread_join( sglob->replicas[ i ]->ri_tid, (void *) NULL );
+#else
pthread_join( sglob->replicas[ i ]->ri_tid, (void *) &status );
+#endif
}
Debug( LDAP_DEBUG_ANY, "slurpd: terminating normally\n", 0, 0, 0 );
sglob->slurpd_shutdown = 1;
pthread_attr_init( &attr );
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
+#if !defined( THREAD_MIT_PTHREADS ) && !defined( THREAD_DCE_PTHREADS )
+ /* POSIX_THREADS or compatible
+ * This is a draft 10 or standard pthreads implementation
+ */
+ if ( pthread_create( &(ri->ri_tid), &attr, (void *) replicate,
+ (void *) ri ) != 0 ) {
+ Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n",
+ ri->ri_hostname, ri->ri_port, 0 );
+ pthread_attr_destroy( &attr );
+ return -1;
+ }
+#else /* draft 4 */
+ /*
+ * This is a draft 4 or earlier pthreads implementation
+ */
if ( pthread_create( &(ri->ri_tid), attr, (void *) replicate,
(void *) ri ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n",
pthread_attr_destroy( &attr );
return -1;
}
+#endif /* draft 4 */
pthread_attr_destroy( &attr );
return 0;
}