version 1.99.2.24, 2008/02/11 23:24:12
|
version 1.99.2.25, 2008/07/07 16:52:30
|
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.99.2.23 2007/03/13 08:53:15 ando Exp $ */ |
/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.99.2.24 2008/02/11 23:24:12 kurt 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 296 wait4msg(
|
Line 296 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 410 try_read1msg(
|
Line 412 try_read1msg(
|
LDAPRequest *lr, *tmplr; |
LDAPRequest *lr, *tmplr; |
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 469 nextresp3:
|
Line 471 nextresp3:
|
} |
} |
if ( tag != LDAP_TAG_MESSAGE ) { |
if ( tag != LDAP_TAG_MESSAGE ) { |
if ( tag == LBER_DEFAULT) { |
if ( tag == 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; |
return -1; |
return -1; |