Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
ceb632b0
Commit
ceb632b0
authored
Sep 04, 2020
by
Howard Chu
Committed by
Quanah Gibson-Mount
Sep 04, 2020
Browse files
ITS#9338 Add backlog control for testing slapd write waits
parent
30778bda
Changes
3
Hide whitespace changes
Inline
Side-by-side
clients/tools/common.c
View file @
ceb632b0
...
...
@@ -182,6 +182,8 @@ static struct tool_ctrls_t {
enum
{
Intr_None
=
0
,
Intr_Abandon
,
Intr_Cancel
,
Intr_Ignore
};
static
volatile
sig_atomic_t
gotintr
,
abcan
;
int
backlog
;
#ifdef LDAP_CONTROL_X_SESSION_TRACKING
static
int
...
...
@@ -672,6 +674,13 @@ tool_args( int argc, char **argv )
gotintr
=
abcan
;
}
}
else
if
(
strcasecmp
(
control
,
"backlog"
)
==
0
)
{
/* special search: accumulate lots of responses
* but don't read any, force slapd writer to wait.
* Then abandon the search and issue a new one.
*/
backlog
=
1
;
}
else
if
(
tool_is_oid
(
control
)
)
{
LDAPControl
*
tmpctrls
,
ctrl
;
...
...
clients/tools/common.h
View file @
ceb632b0
...
...
@@ -98,6 +98,9 @@ extern ber_int_t vlvPos;
extern
ber_int_t
vlvCount
;
extern
struct
berval
*
vlvContext
;
/* features */
extern
int
backlog
;
/* options */
extern
struct
timeval
nettimeout
;
...
...
clients/tools/ldapsearch.c
View file @
ceb632b0
...
...
@@ -1420,6 +1420,7 @@ static int dosearch(
tv_timelimitp
=
&
tv_timelimit
;
}
again:
rc
=
ldap_search_ext
(
ld
,
base
,
scope
,
filter
,
attrs
,
attrsonly
,
sctrls
,
cctrls
,
tv_timelimitp
,
sizelimit
,
&
msgid
);
...
...
@@ -1443,6 +1444,21 @@ static int dosearch(
tvp
=
&
tv
;
}
if
(
backlog
==
1
)
{
printf
(
_
(
"
\n
Waiting for responses to accumulate, press Enter to continue: "
));
fflush
(
stdout
);
getchar
();
printf
(
_
(
"Abandoning msgid %d
\n
"
),
msgid
);
ldap_abandon_ext
(
ld
,
msgid
,
NULL
,
NULL
);
/* turn off syncrepl control */
ldap_set_option
(
ld
,
LDAP_OPT_SERVER_CONTROLS
,
NULL
);
backlog
=
2
;
scope
=
LDAP_SCOPE_BASE
;
goto
again
;
}
else
if
(
backlog
==
2
)
{
tv
.
tv_sec
=
timelimit
;
}
while
((
rc
=
ldap_result
(
ld
,
LDAP_RES_ANY
,
sortattr
?
LDAP_MSG_ALL
:
LDAP_MSG_ONE
,
tvp
,
&
res
))
>
0
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment