]> git.sur5r.net Git - openldap/commitdiff
Add TCP_NODELAY support to client side as well.
authorKurt Zeilenga <kurt@openldap.org>
Fri, 15 Oct 1999 18:18:31 +0000 (18:18 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 15 Oct 1999 18:18:31 +0000 (18:18 +0000)
CHANGES
libraries/libldap/os-ip.c

diff --git a/CHANGES b/CHANGES
index 065a443d842d620ff06261f429a0135668bbdcf1..81bab46b2639d6cba1f7dccd3b327a2c810b356a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,7 +7,7 @@ Changes included in OpenLDAP 1.2 Release Engineering
        Fixed -lldap templates y2k bug (ITS#294)
        Fixed ldbm db_appinit to use u_int32_t instead of int (ITS#295)
        Fixed lber/io.c Cray T90 specific pointer arithmetic problem (ITS#325)
-       Added slapd TCP_NODELAY support
+       Added TCP_NODELAY support
        Documentation
                Reference Quick Start Guide in README and INSTALL
                ldappasswd(1) fix -c vs -H typo (ITS#154)
index 4459d46d22b689dc9e80ec77d8c1d7e7d73393e8..bd666f0bf78de52eef6c0a62b2416798beeeba7c 100644 (file)
@@ -49,11 +49,9 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
        int                     connected, use_hp;
        struct sockaddr_in      sin;
        struct hostent          *hp = NULL;
-#ifdef notyet
-#ifdef LDAP_REFERRALS
-       int                     status; /* for ioctl call */
-#endif /* LDAP_REFERRALS */
-#endif /* notyet */
+#ifdef TCP_NODELAY
+       int                     status; 
+#endif
 
        Debug( LDAP_DEBUG_TRACE, "ldap_connect_to_host: %s:%d\n",
            ( host == NULL ) ? "(by address)" : host, (int) ntohs( (short) port ), 0 );
@@ -82,6 +80,17 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
                if (( s = socket( AF_INET, SOCK_STREAM, 0 )) < 0 ) {
                        return( -1 );
                }
+
+#ifdef TCP_NODELAY
+               status = 1;
+               if( setsockopt( s, IPPROTO_TCP, TCP_NODELAY,
+                       (char *) &status, sizeof(status)) == -1 )
+               {
+                       Debug( LDAP_DEBUG_ANY, "setsockopt(TCP_NODELAY) failed on %d\n",
+                           s, 0, 0 );
+               }
+#endif
+
 #ifdef notyet
 #ifdef LDAP_REFERRALS
                status = 1;