]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/daemon.c
also log cookie parsing
[openldap] / servers / slapd / daemon.c
index 59986a6009d36ac7399ecacb244848658dd990b6..5949e543d732d4b177689720dcaf5778d0fdcae5 100644 (file)
 #endif /* ! epoll && ! /dev/poll */
 
 #ifdef HAVE_TCPD
-# include <tcpd.h>
 int allow_severity = LOG_INFO;
 int deny_severity = LOG_NOTICE;
-
-# define SLAP_STRING_UNKNOWN   STRING_UNKNOWN
-#else /* ! TCP Wrappers */
-# define SLAP_STRING_UNKNOWN   "unknown"
-#endif /* ! TCP Wrappers */
+#endif /* TCP Wrappers */
 
 #ifdef LDAP_PF_LOCAL
 # include <sys/stat.h>
@@ -227,7 +222,8 @@ static struct slap_daemon {
        (int *)(ptr) <= &slap_daemon.sd_index[dtblsize]) ? 0 : 1 )
 
 # define SLAP_EPOLL_EV_PTRFD(ptr)              (SLAP_EPOLL_EV_LISTENER(ptr) ? \
-       ((Listener *)ptr)->sl_sd : (int *)(ptr) - slap_daemon.sd_index)
+       ((Listener *)ptr)->sl_sd : \
+       (ber_socket_t) ((int *)(ptr) - slap_daemon.sd_index))
 
 # define SLAP_SOCK_DEL(s)              do { \
        int fd, rc, index = SLAP_EPOLL_SOCK_IX((s)); \
@@ -1434,7 +1430,7 @@ slapd_daemon_init( const char *urls )
 
 #ifdef HAVE_SYSCONF
        dtblsize = sysconf( _SC_OPEN_MAX );
-#elif HAVE_GETDTABLESIZE
+#elif defined(HAVE_GETDTABLESIZE)
        dtblsize = getdtablesize();
 #else /* ! HAVE_SYSCONF && ! HAVE_GETDTABLESIZE */
        dtblsize = FD_SETSIZE;
@@ -1571,7 +1567,7 @@ slap_listener(
        Sockaddr                from;
 
        ber_socket_t s;
-       socklen_t len = sizeof(from);
+       ber_socklen_t len = sizeof(from);
        Connection *c;
        slap_ssf_t ssf = 0;
        struct berval authid = BER_BVNULL;
@@ -1724,7 +1720,6 @@ slap_listener(
                {
                        uid_t uid;
                        gid_t gid;
-                       int rc;
 
 #ifdef LDAP_PF_LOCAL_SENDMSG
                        peerbv.bv_val = peerbuf;
@@ -1829,10 +1824,7 @@ slap_listener(
                dnsname != NULL ? dnsname : SLAP_STRING_UNKNOWN,
                peername, cflag, ssf,
                authid.bv_val ? &authid : NULL
-#ifdef LDAP_PF_LOCAL_SENDMSG
-               , &peerbv
-#endif
-       );
+               LDAP_PF_LOCAL_SENDMSG_ARG(&peerbv));
 
        if( authid.bv_val ) ch_free(authid.bv_val);
 
@@ -2000,15 +1992,6 @@ slapd_daemon_task(
        }
 #endif /* HAVE_NT_SERVICE_MANAGER */
 
-#ifdef SLAP_SEM_LOAD_CONTROL
-       /*
-        * initialize count and lazyness of a semaphore
-        */
-       (void) ldap_lazy_sem_init(
-               SLAP_MAX_WORKER_THREADS + 4 /* max workers + margin */,
-               4 /* lazyness */ );
-#endif /* SLAP_SEM_LOAD_CONTROL */
-
        /* initialization complete. Here comes the loop. */
 
        while ( !slapd_shutdown ) {
@@ -2538,10 +2521,7 @@ connectionless_init( void )
 
                c = connection_init( lr->sl_sd, lr, "", "",
                        CONN_IS_UDP, (slap_ssf_t) 0, NULL
-#ifdef LDAP_PF_LOCAL_SENDMSG
-                       , NULL
-#endif
-                       );
+                       LDAP_PF_LOCAL_SENDMSG_ARG(NULL));
 
                if ( !c ) {
                        Debug( LDAP_DEBUG_TRACE,
@@ -2657,7 +2637,7 @@ slap_sig_shutdown( int sig )
         * SIGBREAK is generated when a user logs out.
         */
 
-#if HAVE_NT_SERVICE_MANAGER && SIGBREAK
+#if defined(HAVE_NT_SERVICE_MANAGER) && defined(SIGBREAK)
        if (is_NT_Service && sig == SIGBREAK) {
                /* empty */;
        } else