From: Pierangelo Masarati Date: Sat, 13 Jan 2007 15:03:15 +0000 (+0000) Subject: add support to test exceptional behavior (abandon/cancel/ignore) X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~187 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=58b918bea2741c35acc9f3e2b3a0079a977f88fd;p=openldap add support to test exceptional behavior (abandon/cancel/ignore) --- diff --git a/clients/tools/common.c b/clients/tools/common.c index 4cf7edcd40..fbacf5ad29 100644 --- a/clients/tools/common.c +++ b/clients/tools/common.c @@ -202,7 +202,9 @@ N_(" [!]preread[=] (a comma-separated attribute list)\n") #ifdef LDAP_DEVEL N_(" [!]relax\n") #endif -N_(" abandon, cancel (SIGINT sends abandon/cancel; not really controls)\n"), +N_(" abandon, cancel, ignore (SIGINT sends abandon/cancel,\n" + " or ignores response; if critical, doesn't wait for SIGINT.\n" + " not really controls)\n") N_(" -f file read operations from `file'\n"), N_(" -h host LDAP server\n"), N_(" -H URI LDAP Uniform Resource Indentifier(s)\n"), @@ -502,9 +504,21 @@ tool_args( int argc, char **argv ) /* this shouldn't go here, really; but it's a feature... */ } else if ( strcasecmp( control, "abandon" ) == 0 ) { abcan = LDAP_REQ_ABANDON; + if ( crit ) { + gotintr = abcan; + } } else if ( strcasecmp( control, "cancel" ) == 0 ) { abcan = LDAP_REQ_EXTENDED; + if ( crit ) { + gotintr = abcan; + } + + } else if ( strcasecmp( control, "ignore" ) == 0 ) { + abcan = -1; + if ( crit ) { + gotintr = abcan; + } } else { fprintf( stderr, "Invalid general control name: %s\n", @@ -1424,6 +1438,10 @@ tool_check_abandon( LDAP *ld, int msgid ) fprintf( stderr, "got interrupt, abandon got %d: %s\n", rc, ldap_err2string( rc ) ); return -1; + + case -1: + /* just unbind, ignoring the request */ + return -1; } return 0;