]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Enable slapd tcp keep alives
authorKurt Zeilenga <kurt@openldap.org>
Mon, 26 Jul 1999 18:09:39 +0000 (18:09 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 26 Jul 1999 18:09:39 +0000 (18:09 +0000)
CHANGES
servers/slapd/daemon.c

diff --git a/CHANGES b/CHANGES
index 11b0e54f6bab4624f634dc9d7b3b0b5ace55742e..b28342a21f0241156b32ff6ed2877f1a0269a616 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,7 @@ Changes included in OpenLDAP 1.2 Release Engineering
        Import password security fix from -devel (ITS#232)
        Provided slapd workaround for "*" attribute type specifier (ITS#236)
        Fixed slapd attribute type list/only specifier on cn=monitor/config 
+       Enable slapd keep alives.
        Build environment
                Updated to latest Autoconf (AnonCVS)
                Updated to latest aclocal from Automake (AnonCVS)
index 0b6f3c9225da95bf9b7531186238c2fd25554321..eec95b79a9fc044022c2e7659618d2f1fefd102a 100644 (file)
@@ -104,11 +104,21 @@ slapd_daemon(
        i = 1;
        if ( setsockopt( tcps, SOL_SOCKET, SO_REUSEADDR, (char *) &i,
            sizeof(i) ) == -1 ) {
-               Debug( LDAP_DEBUG_ANY, "setsockopt() failed errno %d (%s)",
+               Debug( LDAP_DEBUG_ANY, "setsockopt(reuse) failed errno %d (%s)",
                    errno, errno > -1 && errno < sys_nerr ? sys_errlist[errno] :
                    "unknown", 0 );
        }
 
+#ifdef SO_KEEPALIVE
+       i = 1;
+       if ( setsockopt( tcps, SOL_SOCKET, SO_KEEPALIVE, (char *) &i,
+           sizeof(i) ) == -1 ) {
+               Debug( LDAP_DEBUG_ANY, "setsockopt(keepalive) failed errno %d (%s)",
+                   errno, errno > -1 && errno < sys_nerr ? sys_errlist[errno] :
+                   "unknown", 0 );
+       }
+#endif
+
        (void) memset( (void *) &addr, '\0', sizeof(addr) );
        addr.sin_family = AF_INET;
        addr.sin_addr.s_addr = INADDR_ANY;