]> git.sur5r.net Git - openldap/commitdiff
prefix '*' to only log first occurrence of ignored error
authorPierangelo Masarati <ando@openldap.org>
Tue, 10 Feb 2009 14:10:58 +0000 (14:10 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 10 Feb 2009 14:10:58 +0000 (14:10 +0000)
tests/progs/slapd-bind.c
tests/progs/slapd-common.c
tests/progs/slapd-read.c
tests/progs/slapd-search.c

index 8ccf0259f5464add85f760cf2e0c7d2dfd59d594..8a48edae797f252bb34c254f84121d78f4ec3627 100644 (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;
index 5b7845b66e13f2fa78456e3683f242be839d9b77..c7c18c1a48898602dad3806508379c5b35c7da9e 100644 (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 ]--;
                        }
                }
        }
index fee720524c2194ebc743fc035133c73ba55cb16f..e3617065f7af4125296a659a649f84794536a4fb 100644 (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;
index 76e52d282052423bafa38fe6437ad1212d49ee75..af824164051a2a1ba111a11f71e4914397b1d5c1 100644 (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;