prefix '*' to only log first occurrence of ignored error

This commit is contained in:
Pierangelo Masarati 2009-02-10 14:10:58 +00:00
parent 5d78ca3c6a
commit 017e63119b
4 changed files with 15 additions and 5 deletions

View File

@ -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;

View File

@ -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 ]--;
}
}
}

View File

@ -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;

View File

@ -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;