mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
prefix '*' to only log first occurrence of ignored error
This commit is contained in:
parent
5d78ca3c6a
commit
017e63119b
@ -348,7 +348,7 @@ do_bind( char *uri, char *dn, struct berval *pass, int maxloop,
|
||||
/* if ignore.. */
|
||||
if ( first ) {
|
||||
/* only log if first occurrence */
|
||||
if ( first == 1 ) {
|
||||
if ( ( force < 2 && first > 0 ) || abs(first) == 1 ) {
|
||||
tester_ldap_error( ld, "ldap_sasl_bind_s", NULL );
|
||||
}
|
||||
rc = LDAP_SUCCESS;
|
||||
|
@ -147,6 +147,10 @@ tester_ignore_str2err( const char *err )
|
||||
if ( err[ 0 ] == '!' ) {
|
||||
ignore = 0;
|
||||
err++;
|
||||
|
||||
} else if ( err[ 0 ] == '*' ) {
|
||||
ignore = -1;
|
||||
err++;
|
||||
}
|
||||
|
||||
for ( i = 0; ignore_str2err[ i ].name != NULL; i++ ) {
|
||||
@ -191,16 +195,22 @@ tester_ignore_err( int err )
|
||||
if ( err > 0 ) {
|
||||
if ( err < TESTER_SERVER_LAST ) {
|
||||
rc = ignore_server[ err ];
|
||||
if ( rc ) {
|
||||
if ( rc > 0 ) {
|
||||
ignore_server[ err ]++;
|
||||
|
||||
} else if ( rc < 0 ) {
|
||||
ignore_server[ err ]--;
|
||||
}
|
||||
}
|
||||
|
||||
} else if ( err < 0 ) {
|
||||
if ( -err < TESTER_CLIENT_LAST ) {
|
||||
rc = ignore_client[ -err ];
|
||||
if ( rc ) {
|
||||
if ( rc > 0 ) {
|
||||
ignore_client[ -err ]++;
|
||||
|
||||
} else if ( rc < 0 ) {
|
||||
ignore_server[ err ]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ retry:;
|
||||
/* if ignore.. */
|
||||
if ( first ) {
|
||||
/* only log if first occurrence */
|
||||
if ( force < 2 || first == 1 ) {
|
||||
if ( ( force < 2 && first > 0 ) || abs(first) == 1 ) {
|
||||
tester_ldap_error( ld, buf, NULL );
|
||||
}
|
||||
continue;
|
||||
|
@ -447,7 +447,7 @@ retry:;
|
||||
/* if ignore.. */
|
||||
if ( first ) {
|
||||
/* only log if first occurrence */
|
||||
if ( force < 2 || first == 1 ) {
|
||||
if ( ( force < 2 && first > 0 ) || abs(first) == 1 ) {
|
||||
tester_ldap_error( ld, "ldap_search_ext_s", NULL );
|
||||
}
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user