data.dptr = (char *) &id;
data.dsize = sizeof(ID);
+#ifdef LDBM_PESSIMISTIC
rc = ldbm_cache_store( db, key, data, LDBM_INSERT | LDBM_SYNC );
+#else
+ rc = ldbm_cache_store( db, key, data, LDBM_INSERT );
+#endif
free( dn );
ldbm_cache_close( be, db );
ID id;
Datum key, data;
- Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 );
dn = strdup( dn );
dn_normalize_case( dn );
+ Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 );
/* first check the cache */
if ( (e = cache_find_entry_dn( &li->li_cache, dn )) != NULL ) {
#include <stdio.h>
#include <sys/types.h>
-#include <sys/socket.h>
#include "slap.h"
#include "ldapconfig.h"
#include "back-ldbm.h"
data.dptr = (char *) idl;
data.dsize = (2 + idl->b_nmax) * sizeof(ID);
+#ifdef LDBM_PESSIMISTIC
rc = ldbm_cache_store( db, key, data, LDBM_REPLACE | LDBM_SYNC );
+#else
+ rc = ldbm_cache_store( db, key, data, LDBM_REPLACE );
+#endif
/* Debug( LDAP_DEBUG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */
return( rc );
}
}
- return( NULL );
+ return( strdup("") );
}
/*
* 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
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;
return( 0 );
}
+ /* check for empty oc_required */
+ if(oc->oc_required == NULL) {
+ return( 0 );
+ }
+
/* for each required attribute */
for ( i = 0; oc->oc_required[i] != NULL; i++ ) {
/* see if it's in the entry */
* Start the main file manager thread (in fm.c).
*/
pthread_attr_init( &attr );
+#ifndef THREAD_MIT_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",
exit( 1 );
}
+#else /* !THREAD_MIT_PTHREADS */
+ /*
+ * 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",
+ 0, 0, 0 );
+ exit( 1 );
+
+ }
+#endif /* !THREAD_MIT_PTHREADS */
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;