hints.ai_family = AF_UNSPEC;
snprintf(serv, sizeof serv, "%d", port);
- if (err = getaddrinfo(host, serv, &hints, &res)) {
+ if ( (err = getaddrinfo(host, serv, &hints, &res)) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
"slap_get_listener_addresses: getaddrinfo failed: %s\n",
}
sap = *sal;
+ *sap = NULL;
for ( sai=res; sai; sai=sai->ai_next ) {
if( sai->ai_addr == NULL ) {
*sap = NULL;
break;
}
+
if (*sap != NULL) {
(*sap)->sa_family = sai->ai_family;
sap++;
+ *sap = NULL;
}
}
- *sap = NULL;
freeaddrinfo(res);
#else
struct in_addr in;
Listener *li;
LDAPURLDesc *lud;
unsigned short port;
- int err, addrlen;
+ int err, addrlen = 0;
struct sockaddr **sal, **psal;
int socktype = SOCK_STREAM; /* default to COTS */
)
{
int l;
- time_t last_idle_check = slap_get_time();
+ time_t last_idle_check = 0;
time( &starttime );
+ if ( global_idletimeout > 0 ) {
+ last_idle_check = slap_get_time();
+ }
for ( l = 0; slap_listeners[l] != NULL; l++ ) {
if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
continue;
int emfile = 0;
#define SLAPD_IDLE_CHECK_LIMIT 4
- time_t now = slap_get_time();
+ time_t now;
fd_set readfds;
struct timeval zero;
struct timeval *tvp;
- if( emfile || ( global_idletimeout > 0 && difftime(
- last_idle_check+global_idletimeout/SLAPD_IDLE_CHECK_LIMIT,
- now ) < 0 ))
- {
- connections_timeout_idle(now);
+ if( emfile ) {
+ now = slap_get_time();
+ connections_timeout_idle( now );
+ }
+ else if ( global_idletimeout > 0 ) {
+ now = slap_get_time();
+ if ( difftime( last_idle_check+global_idletimeout/SLAPD_IDLE_CHECK_LIMIT, now ) < 0 ) {
+ connections_timeout_idle( now );
+ }
}
FD_ZERO( &writefds );
slap_ssf_t ssf = 0;
char *authid = NULL;
- char *dnsname;
+ char *dnsname = NULL;
char *peeraddr;
#ifdef LDAP_PF_LOCAL
char peername[MAXPATHLEN + sizeof("PATH=")];