From: Kurt Zeilenga Date: Wed, 4 Aug 1999 23:59:53 +0000 (+0000) Subject: Add copyright notice. X-Git-Tag: TWEB_OL_BASE~280 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c73106936b7c0824903ab38f47faab8770cde831;p=openldap Add copyright notice. --- diff --git a/include/setup.mak b/include/setup.mak index 3d346a4eb8..ad8ddaa022 100644 --- a/include/setup.mak +++ b/include/setup.mak @@ -1,3 +1,7 @@ +# +# Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. +# COPYING RESTRICTIONS APPLY, see COPYRIGHT file +# all: setup.txt diff --git a/servers/ldapd/main.c b/servers/ldapd/main.c index a4250faa96..7f819084bb 100644 --- a/servers/ldapd/main.c +++ b/servers/ldapd/main.c @@ -603,18 +603,31 @@ set_socket( exit( 1 ); } +#ifdef SO_REUSEADDR /* set option so clients can't keep us from coming back up */ - i = 1; + i = 1; if ( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (void *) &i, sizeof(i) ) - < 0 ) { + < 0 ) + { perror( "setsockopt" ); exit( 1 ); } +#endif +#ifdef SO_KEEPALIVE + /* enable keep alives */ + i = 1; + if ( setsockopt( s, SOL_SOCKET, SO_KEEPALIVE, (void *) &i, sizeof(i) ) + < 0 ) + { + perror( "setsockopt" ); + exit( 1 ); + } +#endif /* bind to a name */ (void)memset( (void *)&addr, '\0', sizeof( addr )); addr.sin_family = AF_INET; - addr.sin_addr.s_addr = INADDR_ANY; + addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons( port ); if ( bind( s, (struct sockaddr *) &addr, sizeof(addr) ) ) { perror( "bind" );