mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
ITS#5836 add -S "swamp" mode: send requests without reading replies
This commit is contained in:
parent
1ca5fe851f
commit
638cedebb3
1 changed files with 18 additions and 1 deletions
|
|
@ -71,6 +71,7 @@ usage( char *name, char o )
|
||||||
"[-C] "
|
"[-C] "
|
||||||
"[-F] "
|
"[-F] "
|
||||||
"[-N] "
|
"[-N] "
|
||||||
|
"[-S] "
|
||||||
"[-i <ignore>] "
|
"[-i <ignore>] "
|
||||||
"[-l <loops>] "
|
"[-l <loops>] "
|
||||||
"[-L <outerloops>] "
|
"[-L <outerloops>] "
|
||||||
|
|
@ -82,6 +83,9 @@ usage( char *name, char o )
|
||||||
exit( EXIT_FAILURE );
|
exit( EXIT_FAILURE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Just send requests without reading responses */
|
||||||
|
static int swamp;
|
||||||
|
|
||||||
int
|
int
|
||||||
main( int argc, char **argv )
|
main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
|
|
@ -111,7 +115,7 @@ main( int argc, char **argv )
|
||||||
/* by default, tolerate referrals and no such object */
|
/* by default, tolerate referrals and no such object */
|
||||||
tester_ignore_str2errlist( "REFERRAL,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 ) {
|
switch ( i ) {
|
||||||
case 'A':
|
case 'A':
|
||||||
|
|
@ -201,6 +205,10 @@ main( int argc, char **argv )
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'S':
|
||||||
|
swamp++;
|
||||||
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
scope = ldap_pvt_str2scope( optarg );
|
scope = ldap_pvt_str2scope( optarg );
|
||||||
if ( scope == -1 ) {
|
if ( scope == -1 ) {
|
||||||
|
|
@ -435,6 +443,15 @@ retry:;
|
||||||
for ( ; i < innerloop; i++ ) {
|
for ( ; i < innerloop; i++ ) {
|
||||||
LDAPMessage *res = NULL;
|
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,
|
rc = ldap_search_ext_s( ld, sbase, scope,
|
||||||
filter, attrs, noattrs, NULL, NULL,
|
filter, attrs, noattrs, NULL, NULL,
|
||||||
NULL, LDAP_NO_LIMIT, &res );
|
NULL, LDAP_NO_LIMIT, &res );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue