Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
0af48a3d
Commit
0af48a3d
authored
20 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Add code to aid in testing Abandon/Cancel processing
parent
aa74f02c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clients/tools/ldapsearch.c
+31
-0
31 additions, 0 deletions
clients/tools/ldapsearch.c
with
31 additions
and
0 deletions
clients/tools/ldapsearch.c
+
31
−
0
View file @
0af48a3d
...
...
@@ -48,6 +48,10 @@
#include
<ac/errno.h>
#include
<sys/stat.h>
#if defined(TEST_ABANDON) || defined(TEST_CANCEL)
#include
<ac/signal.h>
#endif
#ifdef HAVE_FCNTL_H
#include
<fcntl.h>
#endif
...
...
@@ -550,6 +554,15 @@ private_conn_setup( LDAP *ld )
}
}
#if defined(TEST_ABANDON) || defined(TEST_CANCEL)
static
int
gotintr
;
RETSIGTYPE
do_sig
(
int
sig
)
{
gotintr
=
1
;
}
#endif
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -609,6 +622,10 @@ main( int argc, char **argv )
attrs
=
&
argv
[
optind
];
}
#if defined(TEST_ABANDON) || defined(TEST_CANCEL)
SIGNAL
(
SIGINT
,
do_sig
);
#endif
if
(
infile
!=
NULL
)
{
if
(
infile
[
0
]
==
'-'
&&
infile
[
1
]
==
'\0'
)
{
fp
=
stdin
;
...
...
@@ -1105,6 +1122,20 @@ static int dosearch(
ldap_msgfree
(
res
);
}
#if defined(TEST_ABANDON) || defined(TEST_CANCEL)
if
(
gotintr
)
{
#ifdef TEST_CANCEL
rc
=
ldap_cancel_s
(
ld
,
msgid
,
NULL
,
NULL
);
fprintf
(
stderr
,
"got interrupt, cancel got %d
\n
"
,
rc
);
return
-
1
;
#endif
#ifdef TEST_ABANDON
rc
=
ldap_abandon
(
ld
,
msgid
);
fprintf
(
stderr
,
"got interrupt, abandon got %d
\n
"
,
rc
);
return
-
1
;
#endif
}
#endif
if
(
rc
==
-
1
)
{
ldap_perror
(
ld
,
"ldap_result"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment