mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-18 21:04:45 -05:00
add support to test exceptional behavior (abandon/cancel/ignore)
This commit is contained in:
parent
ee2370bf42
commit
58b918bea2
1 changed files with 19 additions and 1 deletions
|
|
@ -202,7 +202,9 @@ N_(" [!]preread[=<attrs>] (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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue