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
38f2124c
Commit
38f2124c
authored
17 years ago
by
Quanah Gibson-Mount
Browse files
Options
Downloads
Patches
Plain Diff
new ldap_pvt_thread_pool_setkey API
parent
385beddb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/ldap_pvt_thread.h
+7
-2
7 additions, 2 deletions
include/ldap_pvt_thread.h
libraries/libldap_r/tpool.c
+20
-2
20 additions, 2 deletions
libraries/libldap_r/tpool.c
servers/slapd/overlays/memberof.c
+2
-5
2 additions, 5 deletions
servers/slapd/overlays/memberof.c
with
29 additions
and
9 deletions
include/ldap_pvt_thread.h
+
7
−
2
View file @
38f2124c
...
@@ -268,11 +268,16 @@ ldap_pvt_thread_pool_getkey LDAP_P((
...
@@ -268,11 +268,16 @@ ldap_pvt_thread_pool_getkey LDAP_P((
ldap_pvt_thread_pool_keyfree_t
**
kfree
));
ldap_pvt_thread_pool_keyfree_t
**
kfree
));
LDAP_F
(
int
)
LDAP_F
(
int
)
ldap_pvt_thread_pool_setkey
LDAP_P
((
ldap_pvt_thread_pool_setkey
_x
LDAP_P
((
void
*
ctx
,
void
*
ctx
,
void
*
key
,
void
*
key
,
void
*
data
,
void
*
data
,
ldap_pvt_thread_pool_keyfree_t
*
kfree
));
ldap_pvt_thread_pool_keyfree_t
*
kfree
,
void
**
olddatap
,
ldap_pvt_thread_pool_keyfree_t
**
oldkfreep
));
#define ldap_pvt_thread_pool_setkey( ctx, key, data, kfree ) \
ldap_pvt_thread_pool_setkey_x( (ctx), (key), (data), (kfree), NULL, NULL )
LDAP_F
(
void
)
LDAP_F
(
void
)
ldap_pvt_thread_pool_purgekey
LDAP_P
((
void
*
key
));
ldap_pvt_thread_pool_purgekey
LDAP_P
((
void
*
key
));
...
...
This diff is collapsed.
Click to expand it.
libraries/libldap_r/tpool.c
+
20
−
2
View file @
38f2124c
...
@@ -756,11 +756,13 @@ clear_key_idx( ldap_int_thread_userctx_t *ctx, int i )
...
@@ -756,11 +756,13 @@ clear_key_idx( ldap_int_thread_userctx_t *ctx, int i )
* responsibility to free any existing data with the same key.
* responsibility to free any existing data with the same key.
* kfree() must not call functions taking a tpool argument.
* kfree() must not call functions taking a tpool argument.
*/
*/
int
ldap_pvt_thread_pool_setkey
(
int
ldap_pvt_thread_pool_setkey
_x
(
void
*
xctx
,
void
*
xctx
,
void
*
key
,
void
*
key
,
void
*
data
,
void
*
data
,
ldap_pvt_thread_pool_keyfree_t
*
kfree
)
ldap_pvt_thread_pool_keyfree_t
*
kfree
,
void
**
olddatap
,
ldap_pvt_thread_pool_keyfree_t
**
oldkfreep
)
{
{
ldap_int_thread_userctx_t
*
ctx
=
xctx
;
ldap_int_thread_userctx_t
*
ctx
=
xctx
;
int
i
,
found
;
int
i
,
found
;
...
@@ -776,6 +778,22 @@ int ldap_pvt_thread_pool_setkey(
...
@@ -776,6 +778,22 @@ int ldap_pvt_thread_pool_setkey(
}
}
}
}
if
(
olddatap
)
{
if
(
found
)
{
*
olddatap
=
ctx
->
ltu_key
[
i
].
ltk_data
;
}
else
{
*
olddatap
=
NULL
;
}
}
if
(
oldkfreep
)
{
if
(
found
)
{
*
oldkfreep
=
ctx
->
ltu_key
[
i
].
ltk_free
;
}
else
{
*
oldkfreep
=
NULL
;
}
}
if
(
data
||
kfree
)
{
if
(
data
||
kfree
)
{
if
(
i
>=
MAXKEYS
)
if
(
i
>=
MAXKEYS
)
return
ENOMEM
;
return
ENOMEM
;
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/overlays/memberof.c
+
2
−
5
View file @
38f2124c
...
@@ -234,14 +234,11 @@ memberof_saved_member_set( Operation *op, void *keyp, BerVarray vals )
...
@@ -234,14 +234,11 @@ memberof_saved_member_set( Operation *op, void *keyp, BerVarray vals )
}
else
{
}
else
{
BerVarray
old_vals
=
NULL
;
BerVarray
old_vals
=
NULL
;
ldap_pvt_thread_pool_
g
etkey
(
op
->
o_threadctx
,
ldap_pvt_thread_pool_
s
etkey
_x
(
op
->
o_threadctx
,
key
,
key
,
(
void
**
)
&
old_vals
,
NULL
);
saved_vals
,
memberof_saved_member_free
,
&
old_vals
,
NULL
);
if
(
old_vals
!=
NULL
)
{
if
(
old_vals
!=
NULL
)
{
ber_bvarray_free
(
old_vals
);
ber_bvarray_free
(
old_vals
);
}
}
ldap_pvt_thread_pool_setkey
(
op
->
o_threadctx
,
key
,
saved_vals
,
memberof_saved_member_free
);
}
}
}
}
...
...
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