]> git.sur5r.net Git - openldap/commitdiff
More for ITS#5835
authorQuanah Gibson-Mount <quanah@openldap.org>
Tue, 27 Jan 2009 21:07:32 +0000 (21:07 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 27 Jan 2009 21:07:32 +0000 (21:07 +0000)
servers/slapd/connection.c
servers/slapd/daemon.c
servers/slapd/proto-slap.h

index abd6907a62bf7e0b09aeaff7dbff2decee669c27..9460806b7d56c12b511e91ad9f19f9e59d1a93b2 100644 (file)
@@ -1237,7 +1237,7 @@ int connection_read_activate( ber_socket_t s )
         * thread reads data on it. Otherwise the listener thread will repeatedly
         * submit the same event on it to the pool.
         */
-       rc = slapd_ack_read( s, 0 );
+       rc = slapd_clr_read( s, 0 );
        if ( rc )
                return rc;
 
@@ -1841,7 +1841,7 @@ int connection_write(ber_socket_t s)
 
        assert( connections != NULL );
 
-       slapd_ack_write( s, 0 );
+       slapd_clr_write( s, 0 );
 
        c = connection_get( s );
        if( c == NULL ) {
index fb01e403f34809d4efff0caad573c4774a25ad88..c82260eba88bcfbf78c1489b66facdb34f59a567 100644 (file)
@@ -161,9 +161,6 @@ static struct slap_daemon {
 /***************************************
  * Use epoll infrastructure - epoll(4) *
  ***************************************/
-
-#undef SLAP_EVENT_ACK          /* events trigger once per descriptor */
-
 # define SLAP_EVENT_FNAME              "epoll"
 # define SLAP_EVENTS_ARE_INDEXED       0
 # define SLAP_EPOLL_SOCK_IX(s)         (slap_daemon.sd_index[(s)])
@@ -294,12 +291,10 @@ static struct slap_daemon {
 } while (0)
 
 #elif defined(SLAP_X_DEVPOLL) && defined(HAVE_DEVPOLL)
+
 /*************************************************************
  * Use Solaris' (>= 2.7) /dev/poll infrastructure - poll(7d) *
  *************************************************************/
-
-#define SLAP_EVENT_ACK 1       /* events keep signalling unless we stop them */
-
 # define SLAP_EVENT_FNAME              "/dev/poll"
 # define SLAP_EVENTS_ARE_INDEXED       0
 /*
@@ -475,9 +470,6 @@ static struct slap_daemon {
 } while (0)
 
 #else /* ! epoll && ! /dev/poll */
-
-#define SLAP_EVENT_ACK 1       /* events keep signalling unless we stop them */
-
 # ifdef HAVE_WINSOCK
 # define SLAP_EVENT_FNAME              "WSselect"
 /* Winsock provides a "select" function but its fd_sets are
@@ -935,24 +927,6 @@ slapd_remove(
        WAKE_LISTENER(wake || slapd_gentle_shutdown == 2);
 }
 
-void
-slapd_ack_write( ber_socket_t s, int wake )
-{
-#ifdef SLAP_EVENT_ACK
-       ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
-
-       if ( SLAP_SOCK_IS_WRITE( s )) {
-               assert( SLAP_SOCK_IS_ACTIVE( s ));
-
-               SLAP_SOCK_CLR_WRITE( s );
-               slap_daemon.sd_nwriters--;
-       }
-
-       ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
-#endif
-       WAKE_LISTENER(wake);
-}
-
 void
 slapd_clr_write( ber_socket_t s, int wake )
 {
@@ -985,26 +959,6 @@ slapd_set_write( ber_socket_t s, int wake )
        WAKE_LISTENER(wake);
 }
 
-int
-slapd_ack_read( ber_socket_t s, int wake )
-{
-#ifdef SLAP_EVENT_ACK
-       int rc = 1;
-       ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
-
-       if ( SLAP_SOCK_IS_ACTIVE( s )) {
-               SLAP_SOCK_CLR_READ( s );
-               rc = 0;
-       }
-       ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
-       if ( !rc )
-               WAKE_LISTENER(wake);
-       return rc;
-#else
-       return 0;
-#endif
-}
-
 int
 slapd_clr_read( ber_socket_t s, int wake )
 {
index 3bfe1263703d8878e8900c109c10caa1cd88460f..5837bb50f2b35236e5ed15f43a404d2ac4472643 100644 (file)
@@ -831,10 +831,8 @@ LDAP_SLAPD_F (void) slap_wake_listener LDAP_P((void));
 
 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_ack_write LDAP_P((ber_socket_t s, int wake));
 LDAP_SLAPD_F (void) slapd_set_read LDAP_P((ber_socket_t s, int wake));
 LDAP_SLAPD_F (int) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
-LDAP_SLAPD_F (int) slapd_ack_read LDAP_P((ber_socket_t s, int wake));
 
 LDAP_SLAPD_V (volatile sig_atomic_t) slapd_abrupt_shutdown;
 LDAP_SLAPD_V (volatile sig_atomic_t) slapd_shutdown;