|
@@ -119,10 +119,12 @@ short slapd_housekeeping_timer = 10;
|
|
|
/* Do we support timeout on socket send() ? */
|
|
/* Do we support timeout on socket send() ? */
|
|
|
int have_send_timeouts = 0;
|
|
int have_send_timeouts = 0;
|
|
|
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
PRFileDesc* signalpipe[2];
|
|
PRFileDesc* signalpipe[2];
|
|
|
static int writesignalpipe = SLAPD_INVALID_SOCKET;
|
|
static int writesignalpipe = SLAPD_INVALID_SOCKET;
|
|
|
static int readsignalpipe = SLAPD_INVALID_SOCKET;
|
|
static int readsignalpipe = SLAPD_INVALID_SOCKET;
|
|
|
#define FDS_SIGNAL_PIPE 0
|
|
#define FDS_SIGNAL_PIPE 0
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
static PRThread *disk_thread_p = NULL;
|
|
static PRThread *disk_thread_p = NULL;
|
|
|
static PRCondVar *diskmon_cvar = NULL;
|
|
static PRCondVar *diskmon_cvar = NULL;
|
|
@@ -146,8 +148,6 @@ typedef struct listener_info {
|
|
|
static int listeners = 0; /* number of listener sockets */
|
|
static int listeners = 0; /* number of listener sockets */
|
|
|
static listener_info *listener_idxs = NULL; /* array of indexes of listener sockets in the ct->fd array */
|
|
static listener_info *listener_idxs = NULL; /* array of indexes of listener sockets in the ct->fd array */
|
|
|
|
|
|
|
|
-static int enable_nunc_stans = 0; /* if nunc-stans is set to enabled, set to 1 in slapd_daemon */
|
|
|
|
|
-
|
|
|
|
|
#define SLAPD_POLL_LISTEN_READY(xxflagsxx) (xxflagsxx & PR_POLL_READ)
|
|
#define SLAPD_POLL_LISTEN_READY(xxflagsxx) (xxflagsxx & PR_POLL_READ)
|
|
|
|
|
|
|
|
static int get_configured_connection_table_size();
|
|
static int get_configured_connection_table_size();
|
|
@@ -177,7 +177,9 @@ static void* catch_signals();
|
|
|
HANDLE hServDoneEvent = NULL;
|
|
HANDLE hServDoneEvent = NULL;
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
static int createsignalpipe( void );
|
|
static int createsignalpipe( void );
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#if defined( _WIN32 )
|
|
#if defined( _WIN32 )
|
|
|
/* Set an event to hook the NT Service termination */
|
|
/* Set an event to hook the NT Service termination */
|
|
@@ -393,13 +395,14 @@ static void set_timeval_ms(struct timeval *t, int ms);
|
|
|
static int handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, int secure, int local, Connection **newconn );
|
|
static int handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, int secure, int local, Connection **newconn );
|
|
|
#ifdef ENABLE_NUNC_STANS
|
|
#ifdef ENABLE_NUNC_STANS
|
|
|
static void ns_handle_new_connection(struct ns_job_t *job);
|
|
static void ns_handle_new_connection(struct ns_job_t *job);
|
|
|
-#endif
|
|
|
|
|
|
|
+#else
|
|
|
static void handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll);
|
|
static void handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll);
|
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
|
static int clear_signal(fd_set *readfdset);
|
|
static int clear_signal(fd_set *readfdset);
|
|
|
#else
|
|
#else
|
|
|
static int clear_signal(struct POLL_STRUCT *fds);
|
|
static int clear_signal(struct POLL_STRUCT *fds);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+#endif
|
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
|
static void unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, int n_tcps, PRFileDesc *s_tcps);
|
|
static void unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, int n_tcps, PRFileDesc *s_tcps);
|
|
|
#else
|
|
#else
|
|
@@ -931,6 +934,7 @@ disk_monitoring_thread(void *nothing)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
static void
|
|
static void
|
|
|
handle_listeners(Connection_Table *ct)
|
|
handle_listeners(Connection_Table *ct)
|
|
|
{
|
|
{
|
|
@@ -954,6 +958,7 @@ handle_listeners(Connection_Table *ct)
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+#endif /* !ENABLE_NUNC_STANS */
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
* Convert any pre-existing DES passwords to AES.
|
|
* Convert any pre-existing DES passwords to AES.
|
|
@@ -1219,9 +1224,6 @@ void
|
|
|
ns_enable_listeners()
|
|
ns_enable_listeners()
|
|
|
{
|
|
{
|
|
|
#ifdef ENABLE_NUNC_STANS
|
|
#ifdef ENABLE_NUNC_STANS
|
|
|
- if (!enable_nunc_stans) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
int num_enabled = 0;
|
|
int num_enabled = 0;
|
|
|
listener_info *listener;
|
|
listener_info *listener;
|
|
|
while ((listener = (listener_info *)PR_StackPop(ns_disabled_listeners))) {
|
|
while ((listener = (listener_info *)PR_StackPop(ns_disabled_listeners))) {
|
|
@@ -1280,7 +1282,7 @@ nunc_stans_free(void *ptr)
|
|
|
{
|
|
{
|
|
|
slapi_ch_free((void **)&ptr);
|
|
slapi_ch_free((void **)&ptr);
|
|
|
}
|
|
}
|
|
|
-#endif /* ENABLE_NUNC_STANS */
|
|
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
void slapd_daemon( daemon_ports_t *ports )
|
|
void slapd_daemon( daemon_ports_t *ports )
|
|
|
{
|
|
{
|
|
@@ -1304,7 +1306,9 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
PRFileDesc **fdesp = NULL;
|
|
PRFileDesc **fdesp = NULL;
|
|
|
#endif
|
|
#endif
|
|
|
PRIntn num_poll = 0;
|
|
PRIntn num_poll = 0;
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
PRIntervalTime pr_timeout = PR_MillisecondsToInterval(slapd_wakeup_timer);
|
|
PRIntervalTime pr_timeout = PR_MillisecondsToInterval(slapd_wakeup_timer);
|
|
|
|
|
+#endif
|
|
|
PRThread *time_thread_p;
|
|
PRThread *time_thread_p;
|
|
|
int threads;
|
|
int threads;
|
|
|
int in_referral_mode = config_check_referral_mode();
|
|
int in_referral_mode = config_check_referral_mode();
|
|
@@ -1315,10 +1319,6 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
int connection_table_size = get_configured_connection_table_size();
|
|
int connection_table_size = get_configured_connection_table_size();
|
|
|
the_connection_table= connection_table_new(connection_table_size);
|
|
the_connection_table= connection_table_new(connection_table_size);
|
|
|
|
|
|
|
|
-#ifdef ENABLE_NUNC_STANS
|
|
|
|
|
- enable_nunc_stans = config_get_enable_nunc_stans();
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
#ifdef RESOLVER_NEEDS_LOW_FILE_DESCRIPTORS
|
|
#ifdef RESOLVER_NEEDS_LOW_FILE_DESCRIPTORS
|
|
|
/*
|
|
/*
|
|
|
* Some DNS resolver implementations, such as the one built into
|
|
* Some DNS resolver implementations, such as the one built into
|
|
@@ -1342,10 +1342,10 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
i_unix = ports->i_socket;
|
|
i_unix = ports->i_socket;
|
|
|
#endif /* ENABLE_LDAPI */
|
|
#endif /* ENABLE_LDAPI */
|
|
|
#endif
|
|
#endif
|
|
|
-
|
|
|
|
|
- if (!enable_nunc_stans) {
|
|
|
|
|
- createsignalpipe();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
|
|
+ createsignalpipe();
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
init_shutdown_detect();
|
|
init_shutdown_detect();
|
|
|
|
|
|
|
@@ -1494,9 +1494,7 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
#endif
|
|
#endif
|
|
|
listener_idxs = (listener_info *)slapi_ch_calloc(listeners, sizeof(*listener_idxs));
|
|
listener_idxs = (listener_info *)slapi_ch_calloc(listeners, sizeof(*listener_idxs));
|
|
|
#ifdef ENABLE_NUNC_STANS
|
|
#ifdef ENABLE_NUNC_STANS
|
|
|
- if (enable_nunc_stans) {
|
|
|
|
|
- ns_disabled_listeners = PR_CreateStack("disabled_listeners");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ns_disabled_listeners = PR_CreateStack("disabled_listeners");
|
|
|
#endif
|
|
#endif
|
|
|
/*
|
|
/*
|
|
|
* Convert old DES encoded passwords to AES
|
|
* Convert old DES encoded passwords to AES
|
|
@@ -1504,7 +1502,7 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
convert_pbe_des_to_aes();
|
|
convert_pbe_des_to_aes();
|
|
|
|
|
|
|
|
#ifdef ENABLE_NUNC_STANS
|
|
#ifdef ENABLE_NUNC_STANS
|
|
|
- if (enable_nunc_stans && !g_get_shutdown()) {
|
|
|
|
|
|
|
+ if (!g_get_shutdown()) {
|
|
|
int ii;
|
|
int ii;
|
|
|
PRInt32 maxthreads = 3;
|
|
PRInt32 maxthreads = 3;
|
|
|
if (getenv("MAX_THREADS")) {
|
|
if (getenv("MAX_THREADS")) {
|
|
@@ -1538,7 +1536,7 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-#endif /* ENABLE_NUNC_STANS */
|
|
|
|
|
|
|
+#endif
|
|
|
/* Now we write the pid file, indicating that the server is finally and listening for connections */
|
|
/* Now we write the pid file, indicating that the server is finally and listening for connections */
|
|
|
write_pid_file();
|
|
write_pid_file();
|
|
|
|
|
|
|
@@ -1546,14 +1544,14 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
unfurl_banners(the_connection_table,ports,n_tcps,s_tcps,i_unix);
|
|
unfurl_banners(the_connection_table,ports,n_tcps,s_tcps,i_unix);
|
|
|
|
|
|
|
|
#ifdef ENABLE_NUNC_STANS
|
|
#ifdef ENABLE_NUNC_STANS
|
|
|
- if (enable_nunc_stans && ns_thrpool_wait(tp)) {
|
|
|
|
|
|
|
+ if (ns_thrpool_wait(tp)) {
|
|
|
LDAPDebug( LDAP_DEBUG_ANY,
|
|
LDAPDebug( LDAP_DEBUG_ANY,
|
|
|
"ns_thrpool_wait failed errno %d (%s)\n", errno,
|
|
"ns_thrpool_wait failed errno %d (%s)\n", errno,
|
|
|
slapd_system_strerror(errno), 0 );
|
|
slapd_system_strerror(errno), 0 );
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
- /* The meat of the operation is in a loop on a call to select */
|
|
|
|
|
- while(!enable_nunc_stans && !g_get_shutdown())
|
|
|
|
|
|
|
+
|
|
|
|
|
+#else /* The meat of the operation is in a loop on a call to select */
|
|
|
|
|
+ while(!g_get_shutdown())
|
|
|
{
|
|
{
|
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
|
fd_set readfds;
|
|
fd_set readfds;
|
|
@@ -1616,6 +1614,7 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+#endif /* ENABLE_NUNC_STANS */
|
|
|
/* We get here when the server is shutting down */
|
|
/* We get here when the server is shutting down */
|
|
|
/* Do what we have to do before death */
|
|
/* Do what we have to do before death */
|
|
|
|
|
|
|
@@ -1689,36 +1688,36 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
|
|
|
|
|
threads = g_get_active_threadcnt();
|
|
threads = g_get_active_threadcnt();
|
|
|
while ( threads > 0 ) {
|
|
while ( threads > 0 ) {
|
|
|
- if (!enable_nunc_stans) {
|
|
|
|
|
- PRPollDesc xpd;
|
|
|
|
|
- char x;
|
|
|
|
|
- int spe = 0;
|
|
|
|
|
-
|
|
|
|
|
- /* try to read from the signal pipe, in case threads are
|
|
|
|
|
- * blocked on it. */
|
|
|
|
|
- xpd.fd = signalpipe[0];
|
|
|
|
|
- xpd.in_flags = PR_POLL_READ;
|
|
|
|
|
- xpd.out_flags = 0;
|
|
|
|
|
- spe = PR_Poll(&xpd, 1, PR_INTERVAL_NO_WAIT);
|
|
|
|
|
- if (spe > 0) {
|
|
|
|
|
- spe = PR_Read(signalpipe[0], &x, 1);
|
|
|
|
|
- if (spe < 0) {
|
|
|
|
|
- PRErrorCode prerr = PR_GetError();
|
|
|
|
|
- LDAPDebug( LDAP_DEBUG_ANY, "listener could not clear signal pipe, "
|
|
|
|
|
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
|
|
|
|
|
- prerr, slapd_system_strerror(prerr), 0 );
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- } else if (spe == -1) {
|
|
|
|
|
- PRErrorCode prerr = PR_GetError();
|
|
|
|
|
- LDAPDebug( LDAP_DEBUG_ANY, "PR_Poll() failed, "
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
|
|
+ PRPollDesc xpd;
|
|
|
|
|
+ char x;
|
|
|
|
|
+ int spe = 0;
|
|
|
|
|
+
|
|
|
|
|
+ /* try to read from the signal pipe, in case threads are
|
|
|
|
|
+ * blocked on it. */
|
|
|
|
|
+ xpd.fd = signalpipe[0];
|
|
|
|
|
+ xpd.in_flags = PR_POLL_READ;
|
|
|
|
|
+ xpd.out_flags = 0;
|
|
|
|
|
+ spe = PR_Poll(&xpd, 1, PR_INTERVAL_NO_WAIT);
|
|
|
|
|
+ if (spe > 0) {
|
|
|
|
|
+ spe = PR_Read(signalpipe[0], &x, 1);
|
|
|
|
|
+ if (spe < 0) {
|
|
|
|
|
+ PRErrorCode prerr = PR_GetError();
|
|
|
|
|
+ LDAPDebug( LDAP_DEBUG_ANY, "listener could not clear signal pipe, "
|
|
|
SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
|
|
SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
|
|
|
prerr, slapd_system_strerror(prerr), 0 );
|
|
prerr, slapd_system_strerror(prerr), 0 );
|
|
|
- break;
|
|
|
|
|
- } else {
|
|
|
|
|
- /* no data */
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (spe == -1) {
|
|
|
|
|
+ PRErrorCode prerr = PR_GetError();
|
|
|
|
|
+ LDAPDebug( LDAP_DEBUG_ANY, "PR_Poll() failed, "
|
|
|
|
|
+ SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
|
|
|
|
|
+ prerr, slapd_system_strerror(prerr), 0 );
|
|
|
|
|
+ break;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ /* no data */
|
|
|
}
|
|
}
|
|
|
|
|
+#endif
|
|
|
DS_Sleep(PR_INTERVAL_NO_WAIT);
|
|
DS_Sleep(PR_INTERVAL_NO_WAIT);
|
|
|
if ( threads != g_get_active_threadcnt() ) {
|
|
if ( threads != g_get_active_threadcnt() ) {
|
|
|
LDAPDebug( LDAP_DEBUG_TRACE,
|
|
LDAPDebug( LDAP_DEBUG_TRACE,
|
|
@@ -1763,9 +1762,7 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
connection_table_free(the_connection_table);
|
|
connection_table_free(the_connection_table);
|
|
|
the_connection_table= NULL;
|
|
the_connection_table= NULL;
|
|
|
#ifdef ENABLE_NUNC_STANS
|
|
#ifdef ENABLE_NUNC_STANS
|
|
|
- if (enable_nunc_stans) {
|
|
|
|
|
- ns_thrpool_destroy(tp);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ns_thrpool_destroy(tp);
|
|
|
#endif
|
|
#endif
|
|
|
be_cleanupall ();
|
|
be_cleanupall ();
|
|
|
connection_post_shutdown_cleanup();
|
|
connection_post_shutdown_cleanup();
|
|
@@ -1792,9 +1789,7 @@ void slapd_daemon( daemon_ports_t *ports )
|
|
|
|
|
|
|
|
int signal_listner()
|
|
int signal_listner()
|
|
|
{
|
|
{
|
|
|
- if (enable_nunc_stans) {
|
|
|
|
|
- return( 0 );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
/* Replaces previous macro---called to bump the thread out of select */
|
|
/* Replaces previous macro---called to bump the thread out of select */
|
|
|
#if defined( _WIN32 )
|
|
#if defined( _WIN32 )
|
|
|
if ( PR_Write( signalpipe[1], "", 1) != 1 ) {
|
|
if ( PR_Write( signalpipe[1], "", 1) != 1 ) {
|
|
@@ -1815,19 +1810,18 @@ int signal_listner()
|
|
|
"listener could not write to signal pipe %d\n",
|
|
"listener could not write to signal pipe %d\n",
|
|
|
errno, 0, 0 );
|
|
errno, 0, 0 );
|
|
|
}
|
|
}
|
|
|
|
|
+#endif
|
|
|
#endif
|
|
#endif
|
|
|
return( 0 );
|
|
return( 0 );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
|
static int clear_signal(fd_set *readfdset)
|
|
static int clear_signal(fd_set *readfdset)
|
|
|
#else
|
|
#else
|
|
|
static int clear_signal(struct POLL_STRUCT *fds)
|
|
static int clear_signal(struct POLL_STRUCT *fds)
|
|
|
#endif
|
|
#endif
|
|
|
{
|
|
{
|
|
|
- if (enable_nunc_stans) {
|
|
|
|
|
- return 0;
|
|
|
|
|
- }
|
|
|
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
|
if ( FD_ISSET(readsignalpipe, readfdset)) {
|
|
if ( FD_ISSET(readsignalpipe, readfdset)) {
|
|
|
#else
|
|
#else
|
|
@@ -1850,6 +1844,7 @@ static int clear_signal(struct POLL_STRUCT *fds)
|
|
|
}
|
|
}
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
+#endif /* !ENABLE_NUNC_STANS */
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
|
static void set_timeval_ms(struct timeval *t, int ms)
|
|
static void set_timeval_ms(struct timeval *t, int ms)
|
|
@@ -1994,18 +1989,18 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps
|
|
|
ct->c[i].c_fdi = SLAPD_INVALID_SOCKET_INDEX;
|
|
ct->c[i].c_fdi = SLAPD_INVALID_SOCKET_INDEX;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!enable_nunc_stans) {
|
|
|
|
|
- /* The fds entry for the signalpipe is always FDS_SIGNAL_PIPE (== 0) */
|
|
|
|
|
- count = FDS_SIGNAL_PIPE;
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
|
|
+ /* The fds entry for the signalpipe is always FDS_SIGNAL_PIPE (== 0) */
|
|
|
|
|
+ count = FDS_SIGNAL_PIPE;
|
|
|
#if !defined(_WIN32)
|
|
#if !defined(_WIN32)
|
|
|
- ct->fd[count].fd = signalpipe[0];
|
|
|
|
|
- ct->fd[count].in_flags = SLAPD_POLL_FLAGS;
|
|
|
|
|
- ct->fd[count].out_flags = 0;
|
|
|
|
|
|
|
+ ct->fd[count].fd = signalpipe[0];
|
|
|
|
|
+ ct->fd[count].in_flags = SLAPD_POLL_FLAGS;
|
|
|
|
|
+ ct->fd[count].out_flags = 0;
|
|
|
#else
|
|
#else
|
|
|
- ct->fd[count].fd = NULL;
|
|
|
|
|
|
|
+ ct->fd[count].fd = NULL;
|
|
|
|
|
+#endif
|
|
|
|
|
+ count++;
|
|
|
#endif
|
|
#endif
|
|
|
- count++;
|
|
|
|
|
- }
|
|
|
|
|
/* The fds entry for n_tcps starts with n_tcps and less than n_tcpe */
|
|
/* The fds entry for n_tcps starts with n_tcps and less than n_tcpe */
|
|
|
ct->n_tcps = count;
|
|
ct->n_tcps = count;
|
|
|
if (n_tcps != NULL && accept_new_connections)
|
|
if (n_tcps != NULL && accept_new_connections)
|
|
@@ -2267,6 +2262,7 @@ handle_read_ready(Connection_Table *ct, fd_set *readfds)
|
|
|
#endif /* _WIN32 */
|
|
#endif /* _WIN32 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
static void
|
|
static void
|
|
|
handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll)
|
|
handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll)
|
|
|
{
|
|
{
|
|
@@ -2422,6 +2418,7 @@ handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll)
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
}
|
|
}
|
|
|
|
|
+#endif /* !ENABLE_NUNC_STANS */
|
|
|
|
|
|
|
|
#ifdef ENABLE_NUNC_STANS
|
|
#ifdef ENABLE_NUNC_STANS
|
|
|
#define CONN_NEEDS_CLOSING(c) (c->c_flags & CONN_FLAG_CLOSING) || (c->c_sd == SLAPD_INVALID_SOCKET)
|
|
#define CONN_NEEDS_CLOSING(c) (c->c_flags & CONN_FLAG_CLOSING) || (c->c_sd == SLAPD_INVALID_SOCKET)
|
|
@@ -2481,10 +2478,6 @@ ns_connection_post_io_or_closing(Connection *conn)
|
|
|
#ifdef ENABLE_NUNC_STANS
|
|
#ifdef ENABLE_NUNC_STANS
|
|
|
struct timeval tv;
|
|
struct timeval tv;
|
|
|
|
|
|
|
|
- if (!enable_nunc_stans) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if (CONN_NEEDS_CLOSING(conn)) {
|
|
if (CONN_NEEDS_CLOSING(conn)) {
|
|
|
/* there should only ever be 0 or 1 active closure jobs */
|
|
/* there should only ever be 0 or 1 active closure jobs */
|
|
|
PR_ASSERT((conn->c_ns_close_jobs == 0) || (conn->c_ns_close_jobs == 1));
|
|
PR_ASSERT((conn->c_ns_close_jobs == 0) || (conn->c_ns_close_jobs == 1));
|
|
@@ -3393,10 +3386,10 @@ static int init_shutdown_detect()
|
|
|
(void) SIGNAL( SIGUSR1, slapd_do_nothing );
|
|
(void) SIGNAL( SIGUSR1, slapd_do_nothing );
|
|
|
(void) SIGNAL( SIGUSR2, set_shutdown );
|
|
(void) SIGNAL( SIGUSR2, set_shutdown );
|
|
|
#endif
|
|
#endif
|
|
|
- if (!enable_nunc_stans) {
|
|
|
|
|
- (void) SIGNAL( SIGTERM, set_shutdown );
|
|
|
|
|
- (void) SIGNAL( SIGHUP, set_shutdown );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+#ifndef ENABLE_NUNC_STANS
|
|
|
|
|
+ (void) SIGNAL( SIGTERM, set_shutdown );
|
|
|
|
|
+ (void) SIGNAL( SIGHUP, set_shutdown );
|
|
|
|
|
+#endif
|
|
|
#endif /* _WIN32 */
|
|
#endif /* _WIN32 */
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
@@ -3991,12 +3984,10 @@ netaddr2string(const PRNetAddr *addr, char *addrbuf, size_t addrbuflen)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0
|
|
|
static int
|
|
static int
|
|
|
createsignalpipe( void )
|
|
createsignalpipe( void )
|
|
|
{
|
|
{
|
|
|
- if (enable_nunc_stans) {
|
|
|
|
|
- return( 0 );
|
|
|
|
|
- }
|
|
|
|
|
#if defined( _WIN32 )
|
|
#if defined( _WIN32 )
|
|
|
if ( PR_NewTCPSocketPair(&signalpipe[0])) {
|
|
if ( PR_NewTCPSocketPair(&signalpipe[0])) {
|
|
|
PRErrorCode prerr = PR_GetError();
|
|
PRErrorCode prerr = PR_GetError();
|
|
@@ -4028,6 +4019,7 @@ createsignalpipe( void )
|
|
|
#endif
|
|
#endif
|
|
|
return( 0 );
|
|
return( 0 );
|
|
|
}
|
|
}
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HPUX10
|
|
#ifdef HPUX10
|