mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
fix result bug; add hooks for error selection based on priority (now the last one is selected)
This commit is contained in:
parent
ccef53677f
commit
af8488c37d
@ -359,6 +359,8 @@ meta_back_op_result( struct metaconn *lc, Operation *op )
|
|||||||
{
|
{
|
||||||
int i, rerr = LDAP_SUCCESS;
|
int i, rerr = LDAP_SUCCESS;
|
||||||
struct metasingleconn **lsc;
|
struct metasingleconn **lsc;
|
||||||
|
char *rmsg = NULL;
|
||||||
|
char *rmatch = NULL;
|
||||||
|
|
||||||
for ( i = 0, lsc = lc->conns; lsc[ 0 ] != NULL; ++i, ++lsc ) {
|
for ( i = 0, lsc = lc->conns; lsc[ 0 ] != NULL; ++i, ++lsc ) {
|
||||||
int err = LDAP_SUCCESS;
|
int err = LDAP_SUCCESS;
|
||||||
@ -379,14 +381,6 @@ meta_back_op_result( struct metaconn *lc, Operation *op )
|
|||||||
LDAP_OPT_MATCHED_DN, &match );
|
LDAP_OPT_MATCHED_DN, &match );
|
||||||
err = ldap_back_map_result( err );
|
err = ldap_back_map_result( err );
|
||||||
|
|
||||||
rerr = err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* FIXME: need to rewrite "match" (need rwinfo)
|
|
||||||
*/
|
|
||||||
send_ldap_result( lc->conn, op, err, match, msg, NULL, NULL );
|
|
||||||
|
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG(( "backend", LDAP_DEBUG_NOTICE,
|
LDAP_LOG(( "backend", LDAP_DEBUG_NOTICE,
|
||||||
"meta_back_op_result: target"
|
"meta_back_op_result: target"
|
||||||
@ -403,6 +397,19 @@ meta_back_op_result( struct metaconn *lc, Operation *op )
|
|||||||
( match ? match : "" ) );
|
( match ? match : "" ) );
|
||||||
#endif /* !NEW_LOGGING */
|
#endif /* !NEW_LOGGING */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME: need to rewrite "match" (need rwinfo)
|
||||||
|
*/
|
||||||
|
switch ( err ) {
|
||||||
|
default:
|
||||||
|
rerr = err;
|
||||||
|
rmsg = msg;
|
||||||
|
msg = NULL;
|
||||||
|
rmatch = match;
|
||||||
|
match = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* better test the pointers before freeing? */
|
/* better test the pointers before freeing? */
|
||||||
if ( match ) {
|
if ( match ) {
|
||||||
free( match );
|
free( match );
|
||||||
@ -411,7 +418,10 @@ meta_back_op_result( struct metaconn *lc, Operation *op )
|
|||||||
free( msg );
|
free( msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ( rerr == LDAP_SUCCESS ) ? 0 : -1;
|
send_ldap_result( lc->conn, op, rerr, rmatch, rmsg, NULL, NULL );
|
||||||
|
|
||||||
|
return ( ( rerr == LDAP_SUCCESS ) ? 0 : -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user