mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 10:07:56 -05:00
ITS#9244 Test for network timeout in ldap_int_check_async_open
This commit is contained in:
parent
c787dc9bfe
commit
21b5b33a5b
1 changed files with 12 additions and 5 deletions
|
|
@ -668,14 +668,21 @@ ldap_int_check_async_open( LDAP *ld, ber_socket_t sd )
|
|||
ld->ld_defconn->lconn_status = LDAP_CONNST_CONNECTED;
|
||||
break;
|
||||
|
||||
case -2:
|
||||
/* connect not completed yet, timed out? */
|
||||
LDAP_MUTEX_LOCK( &ld->ld_options.ldo_mutex );
|
||||
if ( time( NULL ) - ld->ld_defconn->lconn_created <= ld->ld_options.ldo_tm_net.tv_sec )
|
||||
{
|
||||
ld->ld_errno = LDAP_X_CONNECTING;
|
||||
LDAP_MUTEX_UNLOCK( &ld->ld_options.ldo_mutex );
|
||||
return rc;
|
||||
}
|
||||
LDAP_MUTEX_UNLOCK( &ld->ld_options.ldo_mutex );
|
||||
/* fallthru */
|
||||
|
||||
default:
|
||||
ld->ld_errno = LDAP_CONNECT_ERROR;
|
||||
return -1;
|
||||
|
||||
case -2:
|
||||
/* connect not completed yet */
|
||||
ld->ld_errno = LDAP_X_CONNECTING;
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifdef HAVE_TLS
|
||||
|
|
|
|||
Loading…
Reference in a new issue