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
3415b384
Commit
3415b384
authored
22 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
cleanup cache search
parent
5c7e6e87
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-meta/cache-search.c
+22
-11
22 additions, 11 deletions
servers/slapd/back-meta/cache-search.c
with
22 additions
and
11 deletions
servers/slapd/back-meta/cache-search.c
+
22
−
11
View file @
3415b384
...
...
@@ -95,15 +95,14 @@
#include
<ac/string.h>
#include
<ac/time.h>
#include
"ldap_pvt.h"
#include
"lutil.h"
#include
"slap.h"
#include
"../back-ldap/back-ldap.h"
#include
"back-meta.h"
#include
"ldap_pvt.h"
#undef ldap_debug
/* silence a warning in ldap-int.h */
#include
"ldap_log.h"
#include
"../../../libraries/libldap/ldap-int.h"
#include
<sys/time.h>
#ifdef LDAP_CACHING
static
Entry
*
...
...
@@ -255,10 +254,10 @@ meta_back_cache_search(
int
i
=
-
1
,
last
=
0
,
candidates
=
0
,
op_type
;
struct
berval
mfilter
;
struct
berval
*
cachebase
=
NULL
;
struct
berval
*
ncachebase
=
NULL
;
struct
berval
cachebase
=
{
0L
,
NULL
}
;
struct
berval
ncachebase
=
{
0L
,
NULL
}
;
struct
berval
cache_suffix
;
struct
berval
tempstr
=
{
0
,
0
};
struct
berval
tempstr
=
{
0
L
,
NULL
};
AttributeName
*
filter_attrs
=
NULL
;
AttributeName
*
new_attrs
=
NULL
;
...
...
@@ -362,20 +361,30 @@ meta_back_cache_search(
#else
/* !NEW_LOGGING */
Debug
(
LDAP_DEBUG_ANY
,
"QUERY ANSWERABLE
\n
"
,
0
,
0
,
0
);
#endif
/* !NEW_LOGGING */
rewriteSession
(
li
->
rwinfo
,
"cacheBase"
,
n
base
->
bv_val
,
rewriteSession
(
li
->
rwinfo
,
"cacheBase"
,
base
->
bv_val
,
conn
,
&
cbase
,
result
);
if
(
result
->
type
!=
SUCCESS
)
{
ldap_pvt_thread_rdwr_runlock
(
&
qm
->
templates
[
i
].
t_rwlock
);
goto
Catch
;
}
cachebase
=
ber_str2bv
(
cbase
,
strlen
(
cbase
),
0
,
NULL
);
dnNormalize
(
NULL
,
cachebase
,
&
ncachebase
);
if
(
cbase
==
NULL
)
{
cachebase
=
*
base
;
}
else
{
cachebase
.
bv_val
=
cbase
;
cachebase
.
bv_len
=
strlen
(
cbase
);
}
dnNormalize
(
NULL
,
&
cachebase
,
&
ncachebase
);
op
->
o_caching_on
=
1
;
op
->
o_callback
=
&
cb
;
li
->
glue_be
->
be_search
(
li
->
glue_be
,
conn
,
op
,
cachebase
,
ncachebase
,
scope
,
deref
,
slimit
,
tlimit
,
li
->
glue_be
->
be_search
(
li
->
glue_be
,
conn
,
op
,
&
cachebase
,
&
ncachebase
,
scope
,
deref
,
slimit
,
tlimit
,
filter
,
filterstr
,
attrs
,
attrsonly
);
ber_memfree
(
ncachebase
.
bv_val
);
if
(
cachebase
.
bv_val
!=
base
->
bv_val
)
{
/* free only if rewritten */
free
(
cachebase
.
bv_val
);
}
ldap_pvt_thread_rdwr_runlock
(
&
qm
->
templates
[
i
].
t_rwlock
);
}
else
{
...
...
@@ -655,7 +664,7 @@ meta_back_cache_search(
}
}
Catch:
Catch:
;
switch
(
result
->
type
)
{
case
SUCCESS
:
rc
=
0
;
...
...
@@ -730,6 +739,7 @@ Catch:
break
;
default:
/* assert(0); */
break
;
}
ldap_pvt_thread_mutex_lock
(
&
cm
->
consistency_mutex
);
...
...
@@ -1218,6 +1228,7 @@ handleLdapResult(
return
0
;
default:
/* assert( 0 ); */
break
;
}
if
(
gotit
==
0
)
{
tv
.
tv_sec
=
0
;
...
...
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