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
af862f8c
Commit
af862f8c
authored
23 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Reworked callback layout, added send_search_entry callback
parent
b17f72ef
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/backglue.c
+34
-9
34 additions, 9 deletions
servers/slapd/backglue.c
servers/slapd/result.c
+9
-4
9 additions, 4 deletions
servers/slapd/result.c
servers/slapd/slap.h
+11
-3
11 additions, 3 deletions
servers/slapd/slap.h
with
54 additions
and
16 deletions
servers/slapd/backglue.c
+
34
−
9
View file @
af862f8c
...
...
@@ -170,6 +170,7 @@ typedef struct glue_state {
char
*
matched
;
int
nrefs
;
BVarray
refs
;
slap_callback
*
prevcb
;
}
glue_state
;
static
void
...
...
@@ -188,7 +189,7 @@ glue_back_response (
LDAPControl
**
ctrls
)
{
glue_state
*
gs
=
op
->
o_
glu
e
;
glue_state
*
gs
=
op
->
o_
callback
->
sc_privat
e
;
if
(
err
==
LDAP_SUCCESS
||
gs
->
err
!=
LDAP_SUCCESS
)
gs
->
err
=
err
;
...
...
@@ -240,13 +241,38 @@ glue_back_sresult (
int
nentries
)
{
glue_state
*
gs
=
op
->
o_
glu
e
;
glue_state
*
gs
=
op
->
o_
callback
->
sc_privat
e
;
gs
->
nentries
+=
nentries
;
glue_back_response
(
c
,
op
,
0
,
0
,
err
,
matched
,
text
,
refs
,
NULL
,
NULL
,
NULL
,
ctrls
);
}
static
int
glue_back_sendentry
(
BackendDB
*
be
,
Connection
*
c
,
Operation
*
op
,
Entry
*
e
,
AttributeName
*
an
,
int
ao
,
LDAPControl
**
ctrls
)
{
slap_callback
*
tmp
=
op
->
o_callback
;
glue_state
*
gs
=
tmp
->
sc_private
;
int
rc
;
op
->
o_callback
=
gs
->
prevcb
;
if
(
op
->
o_callback
&&
op
->
o_callback
->
sc_sendentry
)
{
rc
=
op
->
o_callback
->
sc_sendentry
(
be
,
c
,
op
,
e
,
an
,
ao
,
ctrls
);
}
else
{
rc
=
send_search_entry
(
be
,
c
,
op
,
e
,
an
,
ao
,
ctrls
);
}
op
->
o_callback
=
tmp
;
return
rc
;
}
static
int
glue_back_search
(
BackendDB
*
b0
,
...
...
@@ -268,9 +294,12 @@ glue_back_search (
BackendDB
*
be
;
int
i
,
rc
,
t2limit
=
0
,
s2limit
=
0
;
long
stoptime
=
0
;
glue_state
gs
=
{
0
};
struct
berval
bv
;
glue_state
gs
=
{
0
};
slap_callback
cb
=
{
glue_back_response
,
glue_back_sresult
,
glue_back_sendentry
,
&
gs
};
gs
.
prevcb
=
op
->
o_callback
;
if
(
tlimit
)
{
stoptime
=
slap_get_time
()
+
tlimit
;
...
...
@@ -293,9 +322,7 @@ glue_back_search (
case
LDAP_SCOPE_ONELEVEL
:
case
LDAP_SCOPE_SUBTREE
:
op
->
o_glue
=
&
gs
;
op
->
o_sresult
=
glue_back_sresult
;
op
->
o_response
=
glue_back_response
;
op
->
o_callback
=
&
cb
;
/*
* Execute in reverse order, most general first
...
...
@@ -349,9 +376,7 @@ glue_back_search (
}
break
;
}
op
->
o_sresult
=
NULL
;
op
->
o_response
=
NULL
;
op
->
o_glue
=
NULL
;
op
->
o_callback
=
gs
.
prevcb
;
send_search_result
(
conn
,
op
,
gs
.
err
,
gs
.
matched
,
NULL
,
gs
.
refs
,
NULL
,
gs
.
nentries
);
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/result.c
+
9
−
4
View file @
af862f8c
...
...
@@ -187,8 +187,8 @@ send_ldap_response(
int
rc
;
long
bytes
;
if
(
op
->
o_response
)
{
op
->
o_response
(
conn
,
op
,
tag
,
msgid
,
err
,
matched
,
if
(
op
->
o_
callback
&&
op
->
o_callback
->
sc_
response
)
{
op
->
o_
callback
->
sc_
response
(
conn
,
op
,
tag
,
msgid
,
err
,
matched
,
text
,
ref
,
resoid
,
resdata
,
sasldata
,
ctrls
);
return
;
}
...
...
@@ -548,8 +548,8 @@ send_search_result(
assert
(
!
LDAP_API_ERROR
(
err
)
);
if
(
op
->
o_sresult
)
{
op
->
o_sresult
(
conn
,
op
,
err
,
matched
,
text
,
refs
,
if
(
op
->
o_
callback
&&
op
->
o_callback
->
sc_
sresult
)
{
op
->
o_
callback
->
sc_
sresult
(
conn
,
op
,
err
,
matched
,
text
,
refs
,
ctrls
,
nentries
);
return
;
}
...
...
@@ -631,6 +631,11 @@ send_search_entry(
AttributeDescription
*
ad_entry
=
slap_schema
.
si_ad_entry
;
if
(
op
->
o_callback
&&
op
->
o_callback
->
sc_sendentry
)
{
return
op
->
o_callback
->
sc_sendentry
(
be
,
conn
,
op
,
e
,
attrs
,
attrsonly
,
ctrls
);
}
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ENTRY
,
"send_search_entry: conn %d dn=
\"
%s
\"
%s
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/slap.h
+
11
−
3
View file @
af862f8c
...
...
@@ -1360,6 +1360,16 @@ typedef void (slap_sresult)( struct slap_conn *, struct slap_op *,
ber_int_t
,
const
char
*
,
const
char
*
,
BVarray
,
LDAPControl
**
,
int
nentries
);
typedef
int
(
slap_sendentry
)(
BackendDB
*
,
struct
slap_conn
*
,
struct
slap_op
*
,
Entry
*
,
AttributeName
*
,
int
,
LDAPControl
**
);
typedef
struct
slap_callback
{
slap_response
*
sc_response
;
slap_sresult
*
sc_sresult
;
slap_sendentry
*
sc_sendentry
;
void
*
sc_private
;
}
slap_callback
;
/*
* represents an operation pending from an ldap client
*/
...
...
@@ -1388,11 +1398,9 @@ typedef struct slap_op {
AuthorizationInformation
o_authz
;
BerElement
*
o_ber
;
/* ber of the request */
slap_response
*
o_response
;
/* callback function */
slap_sresult
*
o_sresult
;
/* search result callback */
slap_callback
*
o_callback
;
/* callback pointers */
LDAPControl
**
o_ctrls
;
/* controls */
void
*
o_glue
;
/* for the glue backend */
void
*
o_private
;
/* anything the backend needs */
LDAP_STAILQ_ENTRY
(
slap_op
)
o_next
;
/* next operation in list */
...
...
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