From: Kurt Zeilenga Date: Fri, 15 Oct 1999 18:18:31 +0000 (+0000) Subject: Add TCP_NODELAY support to client side as well. X-Git-Tag: OPENLDAP_REL_ENG_1_2_8~17 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4b49884677016715d14c62929d51a0f7aa136ac6;p=openldap Add TCP_NODELAY support to client side as well. --- diff --git a/CHANGES b/CHANGES index 065a443d84..81bab46b26 100644 --- 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) diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 4459d46d22..bd666f0bf7 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -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;