More cleanup

This commit is contained in:
Kurt Zeilenga 2005-10-14 22:04:03 +00:00
parent ce96e57298
commit 577bfc477e
3 changed files with 20 additions and 12 deletions

View File

@ -1498,14 +1498,14 @@ int connection_read(ber_socket_t s)
ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
#ifdef SLAP_LIGHTWEIGHT_LISTENER
slapd_resume( s );
slapd_resume( s, 1 );
#endif
return 0;
}
if ( c->c_conn_state == SLAP_C_CLIENT ) {
#ifdef SLAP_LIGHTWEIGHT_LISTENER
slapd_resume( s );
slapd_resume( s, 1 );
#endif
slapd_clr_read( s, 0 );
ldap_pvt_thread_pool_submit( &connection_pool,
@ -1589,7 +1589,7 @@ int connection_read(ber_socket_t s)
ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
#ifdef SLAP_LIGHTWEIGHT_LISTENER
slapd_resume( s );
slapd_resume( s, 1 );
#endif
return 0;
}
@ -1604,7 +1604,7 @@ int connection_read(ber_socket_t s)
ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
#ifdef SLAP_LIGHTWEIGHT_LISTENER
slapd_resume( s );
slapd_resume( s, 1 );
#endif
return 0;
}
@ -1621,7 +1621,7 @@ int connection_read(ber_socket_t s)
/* connections_mutex and c_mutex are locked */
#ifdef SLAP_LIGHTWEIGHT_LISTENER
slapd_resume( s );
slapd_resume( s, 1 );
#endif
connection_closing( c, "SASL layer install failure" );
connection_close( c );
@ -1676,7 +1676,7 @@ int connection_read(ber_socket_t s)
}
#ifdef SLAP_LIGHTWEIGHT_LISTENER
if ( need_resume ) slapd_resume( s );
if ( need_resume ) slapd_resume( s, 1 );
#endif
if ( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_READ, NULL ) ) {

View File

@ -584,7 +584,7 @@ int slapd_suspend(ber_socket_t s) {
return rc;
}
void slapd_resume ( ber_socket_t s ) {
void slapd_resume ( ber_socket_t s, int wake ) {
ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
SLAP_SOCK_SET_READ( s );
@ -595,7 +595,7 @@ void slapd_resume ( ber_socket_t s ) {
ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
WAKE_LISTENER(1);
WAKE_LISTENER(wake);
}
#endif
@ -1364,13 +1364,14 @@ connection_accept(
# endif /* LDAP_PF_LOCAL */
s = accept( sl->sl_sd, (struct sockaddr *) &from, &len );
#ifdef SLAP_LIGHTWEIGHT_LISTENER
/*
* As soon as a TCP connection is accepted, the listener FD is resumed
* for concurrent-processing of incoming TCP connections.
/* Resume the listener FD to allow concurrent-processing of
* additional incoming connections.
*/
slapd_resume( sl->sl_sd );
slapd_resume( sl->sl_sd, 1 );
#endif
if ( s == AC_SOCKET_INVALID ) {
int err = sock_errno();

View File

@ -652,7 +652,9 @@ LDAP_SLAPD_F (const char *) connection_state2str LDAP_P(( int state ))
LDAP_GCCATTR((const));
LDAP_SLAPD_F (int) connection_write LDAP_P((ber_socket_t s));
#ifdef SLAP_LIGHTWEIGHT_LISTENER
LDAP_SLAPD_F (int) connection_read_activate LDAP_P((ber_socket_t s));
LDAP_SLAPD_F (int) connection_read LDAP_P((ber_socket_t, Operation **));
#else
LDAP_SLAPD_F (int) connection_read LDAP_P((ber_socket_t s));
@ -720,6 +722,11 @@ LDAP_SLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig));
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig));
LDAP_SLAPD_F (void) slap_wake_listener LDAP_P((void));
#ifdef SLAP_LIGHTWEIGHT_LISTENER
LDAP_SLAPD_F (int) slapd_suspend LDAP_P((ber_socket_t s));
LDAP_SLAPD_F (void) slapd_resume LDAP_P((ber_socket_t s, int wake ));
#endif
LDAP_SLAPD_F (void) slapd_set_write LDAP_P((ber_socket_t s, int wake));
LDAP_SLAPD_F (void) slapd_clr_write LDAP_P((ber_socket_t s, int wake));
LDAP_SLAPD_F (void) slapd_set_read LDAP_P((ber_socket_t s, int wake));