version 1.118, 2005/10/11 22:31:05
|
version 1.119, 2005/11/12 17:42:04
|
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.117 2005/10/11 22:23:31 hyc Exp $ */ |
/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.118 2005/10/11 22:31:05 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-2005 The OpenLDAP Foundation. |
* Copyright 1998-2005 The OpenLDAP Foundation. |
Line 565 nextresp2:
|
Line 565 nextresp2:
|
ber_len_t len; |
ber_len_t len; |
char *lr_res_error = NULL; |
char *lr_res_error = NULL; |
|
|
|
#ifdef LDAP_NULL_IS_NULL |
|
if ( ber_scanf( &tmpber, "{eAA",/*}*/ &lderr, |
|
&lr->lr_res_matched, &lr_res_error ) |
|
!= LBER_ERROR ) |
|
#else /* ! LDAP_NULL_IS_NULL */ |
if ( ber_scanf( &tmpber, "{eaa",/*}*/ &lderr, |
if ( ber_scanf( &tmpber, "{eaa",/*}*/ &lderr, |
&lr->lr_res_matched, &lr_res_error ) |
&lr->lr_res_matched, &lr_res_error ) |
!= LBER_ERROR ) |
!= LBER_ERROR ) |
|
#endif /* ! LDAP_NULL_IS_NULL */ |
{ |
{ |
if ( lr_res_error != NULL ) { |
if ( lr_res_error != NULL ) { |
if ( lr->lr_res_error != NULL ) { |
#ifndef LDAP_NULL_IS_NULL |
(void)ldap_append_referral( ld, &lr->lr_res_error, lr_res_error ); |
if ( lr_res_error[ 0 ] == '\0' ) { |
LDAP_FREE( (char *)lr_res_error ); |
LDAP_FREE( lr_res_error ); |
|
lr_res_error = NULL; |
|
} else |
|
#endif /* ! LDAP_NULL_IS_NULL */ |
|
{ |
|
if ( lr->lr_res_error != NULL ) { |
|
(void)ldap_append_referral( ld, &lr->lr_res_error, lr_res_error ); |
|
LDAP_FREE( (char *)lr_res_error ); |
|
|
} else { |
} else { |
lr->lr_res_error = lr_res_error; |
lr->lr_res_error = lr_res_error; |
|
} |
} |
} |
|
lr_res_error = NULL; |
} |
} |
|
|
/* Check if V3 referral */ |
/* Check if V3 referral */ |
Line 649 nextresp2:
|
Line 664 nextresp2:
|
*/ |
*/ |
if ( tag == LDAP_RES_SEARCH_RESULT ) |
if ( tag == LDAP_RES_SEARCH_RESULT ) |
refer_cnt = 0; |
refer_cnt = 0; |
|
#ifdef LDAP_NULL_IS_NULL |
|
} else if ( ber_scanf( &tmpber, "{eAA}", &lderr, |
|
&lr->lr_res_matched, &lr_res_error ) |
|
!= LBER_ERROR ) |
|
#else /* ! LDAP_NULL_IS_NULL */ |
} else if ( ber_scanf( &tmpber, "{eaa}", &lderr, |
} else if ( ber_scanf( &tmpber, "{eaa}", &lderr, |
&lr->lr_res_matched, &lr_res_error ) |
&lr->lr_res_matched, &lr_res_error ) |
!= LBER_ERROR ) |
!= LBER_ERROR ) |
|
#endif /* ! LDAP_NULL_IS_NULL */ |
{ |
{ |
if ( lr_res_error != NULL ) { |
if ( lr_res_error != NULL ) { |
if ( lr->lr_res_error != NULL ) { |
#ifndef LDAP_NULL_IS_NULL |
(void)ldap_append_referral( ld, &lr->lr_res_error, lr_res_error ); |
if ( lr_res_error[ 0 ] == '\0' ) { |
LDAP_FREE( (char *)lr_res_error ); |
LDAP_FREE( lr_res_error ); |
} else { |
} else |
lr->lr_res_error = lr_res_error; |
#endif /* ! LDAP_NULL_IS_NULL */ |
|
{ |
|
if ( lr->lr_res_error != NULL ) { |
|
(void)ldap_append_referral( ld, &lr->lr_res_error, lr_res_error ); |
|
LDAP_FREE( (char *)lr_res_error ); |
|
} else { |
|
lr->lr_res_error = lr_res_error; |
|
} |
} |
} |
lr_res_error = NULL; |
lr_res_error = NULL; |
} |
} |
Line 697 nextresp2:
|
Line 725 nextresp2:
|
} else { |
} else { |
lr->lr_res_errno = LDAP_PARTIAL_RESULTS; |
lr->lr_res_errno = LDAP_PARTIAL_RESULTS; |
} |
} |
Debug( LDAP_DEBUG_TRACE, |
|
"new result: res_errno: %d, res_error: <%s>, res_matched: <%s>\n", |
Debug( LDAP_DEBUG_TRACE, "new result: " |
lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "", |
"res_errno: %d, " |
lr->lr_res_matched ? lr->lr_res_matched : "" ); |
"res_error: <%s>, " |
|
"res_matched: <%s>\n", |
|
lr->lr_res_errno, |
|
lr->lr_res_error ? lr->lr_res_error : "", |
|
lr->lr_res_matched ? lr->lr_res_matched : "" ); |
|
} |
|
|
|
/* in any case, don't leave any lr_res_error 'round */ |
|
if ( lr_res_error ) { |
|
LDAP_FREE( lr_res_error ); |
} |
} |
} |
} |
|
|