~ubuntu-branches/ubuntu/wily/openldap/wily-proposed

« back to all changes in this revision

Viewing changes to tests/progs/slapd-common.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-02-24 14:27:35 UTC
  • mfrom: (1.1.3 upstream)
  • mto: (0.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20090224142735-e73y1g4r2pj6wdbf
Tags: 2.4.15-1
* New upstream version
  - Fixes a bug with the pcache overlay not returning cached entries
    (closes: #497697)
  - Update evolution-ntlm patch to apply to current Makefiles.
  - (tentatively) drop gnutls-ciphers, since this bug was reported to be
    fixed upstream in 2.4.8.  The fix applied in 2.4.8 didn't match the
    patch from the bug report, so this should be watched for regressions.
* Build against db4.7 instead of db4.2 at last!  Closes: #421946.
* Build with --disable-ndb, to avoid a misbuild when libmysqlclient is
  installed in the build environment.
* Add -D_GNU_SOURCE to CFLAGS, apparently required for building with
  current headers in unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenLDAP: pkg/ldap/tests/progs/slapd-common.c,v 1.4.2.6 2008/02/11 23:26:50 kurt Exp $ */
 
1
/* $OpenLDAP: pkg/ldap/tests/progs/slapd-common.c,v 1.4.2.8 2009/02/10 17:13:05 quanah Exp $ */
2
2
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3
3
 *
4
 
 * Copyright 1999-2008 The OpenLDAP Foundation.
 
4
 * Copyright 1999-2009 The OpenLDAP Foundation.
5
5
 * All rights reserved.
6
6
 *
7
7
 * Redistribution and use in source and binary forms, with or without
40
40
 
41
41
#define TESTER_SERVER_LAST      (LDAP_OTHER + 1)
42
42
#define TESTER_CLIENT_LAST      (- LDAP_REFERRAL_LIMIT_EXCEEDED + 1)
43
 
static unsigned ignore_server[ TESTER_SERVER_LAST ];
44
 
static unsigned ignore_client[ TESTER_CLIENT_LAST ];
 
43
static int ignore_server[ TESTER_SERVER_LAST ];
 
44
static int ignore_client[ TESTER_CLIENT_LAST ];
45
45
 
46
46
static struct {
47
47
        char    *name;
126
126
static int
127
127
tester_ignore_str2err( const char *err )
128
128
{
129
 
        int             i;
130
 
        unsigned        ignore = 1;
 
129
        int             i, ignore = 1;
131
130
 
132
131
        if ( strcmp( err, "ALL" ) == 0 ) {
133
132
                for ( i = 0; ignore_str2err[ i ].name != NULL; i++ ) {
147
146
        if ( err[ 0 ] == '!' ) {
148
147
                ignore = 0;
149
148
                err++;
 
149
 
 
150
        } else if ( err[ 0 ] == '*' ) {
 
151
                ignore = -1;
 
152
                err++;
150
153
        }
151
154
 
152
155
        for ( i = 0; ignore_str2err[ i ].name != NULL; i++ ) {
183
186
        return 0;
184
187
}
185
188
 
186
 
unsigned
 
189
int
187
190
tester_ignore_err( int err )
188
191
{
189
 
        unsigned        rc = 1;
 
192
        int rc = 1;
190
193
 
191
194
        if ( err > 0 ) {
192
195
                if ( err < TESTER_SERVER_LAST ) {
193
196
                        rc = ignore_server[ err ];
194
 
                        if ( rc ) {
 
197
                        if ( rc > 0 ) {
195
198
                                ignore_server[ err ]++;
 
199
 
 
200
                        } else if ( rc < 0 ) {
 
201
                                ignore_server[ err ]--;
196
202
                        }
197
203
                }
198
204
 
199
205
        } else if ( err < 0 ) {
200
206
                if ( -err < TESTER_CLIENT_LAST ) {
201
207
                        rc = ignore_client[ -err ];
202
 
                        if ( rc ) {
 
208
                        if ( rc > 0 ) {
203
209
                                ignore_client[ -err ]++;
 
210
 
 
211
                        } else if ( rc < 0 ) {
 
212
                                ignore_server[ err ]--;
204
213
                        }
205
214
                }
206
215
        }