From: Quanah Gibson-Mount Date: Wed, 1 Jul 2009 19:09:44 +0000 (+0000) Subject: ITS#5836, add -S "swamp" mode. X-Git-Tag: OPENLDAP_REL_ENG_2_4_17~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=26cbc5f5e925f8848ecb388f3c91831df9a1f12d;p=openldap ITS#5836, add -S "swamp" mode. --- diff --git a/tests/progs/slapd-search.c b/tests/progs/slapd-search.c index 6b15ab4ecc..c3aa0ee227 100644 --- a/tests/progs/slapd-search.c +++ b/tests/progs/slapd-search.c @@ -71,6 +71,7 @@ usage( char *name, char o ) "[-C] " "[-F] " "[-N] " + "[-S] " "[-i ] " "[-l ] " "[-L ] " @@ -82,6 +83,9 @@ usage( char *name, char o ) exit( EXIT_FAILURE ); } +/* Just send requests without reading responses */ +static int swamp; + int main( int argc, char **argv ) { @@ -111,7 +115,7 @@ main( int argc, char **argv ) /* by default, tolerate referrals and no such object */ tester_ignore_str2errlist( "REFERRAL,NO_SUCH_OBJECT" ); - while ( ( i = getopt( argc, argv, "Aa:b:CD:f:FH:h:i:l:L:Np:r:s:t:T:w:" ) ) != EOF ) + while ( ( i = getopt( argc, argv, "Aa:b:CD:f:FH:h:i:l:L:Np:r:Ss:t:T:w:" ) ) != EOF ) { switch ( i ) { case 'A': @@ -201,6 +205,10 @@ main( int argc, char **argv ) } break; + case 'S': + swamp++; + break; + case 's': scope = ldap_pvt_str2scope( optarg ); if ( scope == -1 ) { @@ -435,6 +443,15 @@ retry:; for ( ; i < innerloop; i++ ) { LDAPMessage *res = NULL; + if (swamp) { + int msgid; + rc = ldap_search_ext( ld, sbase, scope, + filter, NULL, noattrs, NULL, NULL, + NULL, LDAP_NO_LIMIT, &msgid ); + if ( rc == LDAP_SUCCESS ) continue; + else break; + } + rc = ldap_search_ext_s( ld, sbase, scope, filter, attrs, noattrs, NULL, NULL, NULL, LDAP_NO_LIMIT, &res );