version 1.102, 2005/05/21 12:52:19
|
version 1.103, 2005/07/07 14:09:41
|
Line 1
|
Line 1
|
/* result.c - wait for an ldap result */ |
/* result.c - wait for an ldap result */ |
/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.101 2005/05/02 22:03:02 jongchoi Exp $ */ |
/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.102 2005/05/21 12:52:19 ando Exp $ */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
* Copyright 1998-2005 The OpenLDAP Foundation. |
* Copyright 1998-2005 The OpenLDAP Foundation. |
Line 251 wait4msg(
|
Line 251 wait4msg(
|
LDAPMessage **result ) |
LDAPMessage **result ) |
{ |
{ |
int rc; |
int rc; |
struct timeval tv, *tvp; |
struct timeval tv, tv0, *tvp; |
time_t start_time = 0; |
time_t start_time = 0; |
time_t tmp_time; |
time_t tmp_time; |
LDAPConn *lc, *nextlc; |
LDAPConn *lc, *nextlc; |
Line 272 wait4msg(
|
Line 272 wait4msg(
|
if ( timeout == NULL ) { |
if ( timeout == NULL ) { |
tvp = NULL; |
tvp = NULL; |
} else { |
} else { |
|
tv0 = *timeout; |
tv = *timeout; |
tv = *timeout; |
tvp = &tv; |
tvp = &tv; |
start_time = time( NULL ); |
start_time = time( NULL ); |
Line 358 wait4msg(
|
Line 359 wait4msg(
|
|
|
if ( rc == -2 && tvp != NULL ) { |
if ( rc == -2 && tvp != NULL ) { |
tmp_time = time( NULL ); |
tmp_time = time( NULL ); |
if (( tv.tv_sec -= ( tmp_time - start_time )) <= 0 ) { |
if (( tv0.tv_sec -= ( tmp_time - start_time )) <= 0 ) { |
rc = 0; /* timed out */ |
rc = 0; /* timed out */ |
ld->ld_errno = LDAP_TIMEOUT; |
ld->ld_errno = LDAP_TIMEOUT; |
break; |
break; |
} |
} |
|
tv.tv_sec = tv0.tv_sec; |
|
|
Debug( LDAP_DEBUG_TRACE, "wait4msg: %ld secs to go\n", |
Debug( LDAP_DEBUG_TRACE, "wait4msg: %ld secs to go\n", |
(long) tv.tv_sec, 0, 0 ); |
(long) tv.tv_sec, 0, 0 ); |