version 1.160, 2008/05/27 23:19:43
|
version 1.161, 2008/07/02 14:43:51
|
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.159 2008/01/07 23:20:04 kurt Exp $ */ |
/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.160 2008/05/27 23:19:43 hyc 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-2008 The OpenLDAP Foundation. |
* Copyright 1998-2008 The OpenLDAP Foundation. |
Line 351 wait4msg(
|
Line 351 wait4msg(
|
#endif |
#endif |
|
|
if ( !lc_ready ) { |
if ( !lc_ready ) { |
|
int err; |
rc = ldap_int_select( ld, tvp ); |
rc = ldap_int_select( ld, tvp ); |
#ifdef LDAP_DEBUG |
|
if ( rc == -1 ) { |
if ( rc == -1 ) { |
|
err = sock_errno(); |
|
#ifdef LDAP_DEBUG |
Debug( LDAP_DEBUG_TRACE, |
Debug( LDAP_DEBUG_TRACE, |
"ldap_int_select returned -1: errno %d\n", |
"ldap_int_select returned -1: errno %d\n", |
sock_errno(), 0, 0 ); |
err, 0, 0 ); |
} |
|
#endif |
#endif |
|
} |
|
|
if ( rc == 0 || ( rc == -1 && ( |
if ( rc == 0 || ( rc == -1 && ( |
!LDAP_BOOL_GET(&ld->ld_options, LDAP_BOOL_RESTART) |
!LDAP_BOOL_GET(&ld->ld_options, LDAP_BOOL_RESTART) |
|| sock_errno() != EINTR ) ) ) |
|| err != EINTR ) ) ) |
{ |
{ |
ld->ld_errno = (rc == -1 ? LDAP_SERVER_DOWN : |
ld->ld_errno = (rc == -1 ? LDAP_SERVER_DOWN : |
LDAP_TIMEOUT); |
LDAP_TIMEOUT); |
Line 493 try_read1msg(
|
Line 495 try_read1msg(
|
LDAPRequest *lr, *tmplr, dummy_lr = { 0 }; |
LDAPRequest *lr, *tmplr, dummy_lr = { 0 }; |
LDAPConn *lc; |
LDAPConn *lc; |
BerElement tmpber; |
BerElement tmpber; |
int rc, refer_cnt, hadref, simple_request; |
int rc, refer_cnt, hadref, simple_request, err; |
ber_int_t lderr; |
ber_int_t lderr; |
|
|
#ifdef LDAP_CONNECTIONLESS |
#ifdef LDAP_CONNECTIONLESS |
Line 547 nextresp3:
|
Line 549 nextresp3:
|
break; |
break; |
|
|
case LBER_DEFAULT: |
case LBER_DEFAULT: |
|
err = sock_errno(); |
#ifdef LDAP_DEBUG |
#ifdef LDAP_DEBUG |
Debug( LDAP_DEBUG_CONNS, |
Debug( LDAP_DEBUG_CONNS, |
"ber_get_next failed.\n", 0, 0, 0 ); |
"ber_get_next failed.\n", 0, 0, 0 ); |
#endif |
#endif |
#ifdef EWOULDBLOCK |
#ifdef EWOULDBLOCK |
if ( sock_errno() == EWOULDBLOCK ) return LDAP_MSG_X_KEEP_LOOKING; |
if ( err == EWOULDBLOCK ) return LDAP_MSG_X_KEEP_LOOKING; |
#endif |
#endif |
#ifdef EAGAIN |
#ifdef EAGAIN |
if ( sock_errno() == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING; |
if ( err == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING; |
#endif |
#endif |
ld->ld_errno = LDAP_SERVER_DOWN; |
ld->ld_errno = LDAP_SERVER_DOWN; |
#ifdef LDAP_R_COMPILE |
#ifdef LDAP_R_COMPILE |