Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
fcc59c64
Commit
fcc59c64
authored
Aug 14, 2003
by
Jong Hyuk Choi
Browse files
Proxy caching update : op->o_caching_on flag removed
parent
d1131664
Changes
8
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-ldbm/add.c
View file @
fcc59c64
...
...
@@ -39,15 +39,7 @@ ldbm_back_add(
Debug
(
LDAP_DEBUG_ARGS
,
"==> ldbm_back_add: %s
\n
"
,
op
->
o_req_dn
.
bv_val
,
0
,
0
);
#endif
#ifndef LDAP_CACHING
rs
->
sr_err
=
entry_schema_check
(
op
->
o_bd
,
op
->
oq_add
.
rs_e
,
NULL
,
&
rs
->
sr_text
,
textbuf
,
textlen
);
#else
/* LDAP_CACHING */
if
(
!
op
->
o_caching_on
)
{
rs
->
sr_err
=
entry_schema_check
(
op
->
o_bd
,
op
->
oq_add
.
rs_e
,
NULL
,
&
rs
->
sr_text
,
textbuf
,
textlen
);
}
else
{
rs
->
sr_err
=
LDAP_SUCCESS
;
}
#endif
/* LDAP_CACHING */
if
(
rs
->
sr_err
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
...
...
@@ -70,9 +62,6 @@ ldbm_back_add(
subentry
=
is_entry_subentry
(
op
->
oq_add
.
rs_e
);
#endif
#ifdef LDAP_CACHING
if
(
!
op
->
o_caching_on
)
{
#endif
/* LDAP_CACHING */
if
(
!
access_allowed
(
op
,
op
->
oq_add
.
rs_e
,
entry
,
NULL
,
ACL_WRITE
,
NULL
)
)
{
...
...
@@ -94,9 +83,6 @@ ldbm_back_add(
return
-
1
;
#endif
}
#ifdef LDAP_CACHING
}
#endif
/* LDAP_CACHING */
/* grab giant lock for writing */
ldap_pvt_thread_rdwr_wlock
(
&
li
->
li_giant_rwlock
);
...
...
@@ -125,11 +111,7 @@ ldbm_back_add(
dnParent
(
&
op
->
o_req_ndn
,
&
pdn
);
}
#ifndef LDAP_CACHING
if
(
pdn
.
bv_len
)
#else
/* LDAP_CACHING */
if
(
pdn
.
bv_len
&&
!
op
->
o_caching_on
)
#endif
/* LDAP_CACHING */
{
Entry
*
matched
=
NULL
;
...
...
@@ -277,21 +259,13 @@ ldbm_back_add(
#endif
}
else
{
#ifndef LDAP_CACHING
if
(
pdn
.
bv_val
!=
NULL
)
#else
/* LDAP_CACHING */
if
(
pdn
.
bv_val
!=
NULL
&&
!
op
->
o_caching_on
)
#endif
/* LDAP_CACHING */
{
assert
(
*
pdn
.
bv_val
==
'\0'
);
}
/* no parent, must be adding entry to root */
#ifndef LDAP_CACHING
if
(
!
be_isroot
(
op
->
o_bd
,
&
op
->
o_ndn
)
)
#else
/* LDAP_CACHING */
if
(
!
be_isroot
(
op
->
o_bd
,
&
op
->
o_ndn
)
&&
!
op
->
o_caching_on
)
#endif
/* LDAP_CACHING */
{
if
(
be_issuffix
(
op
->
o_bd
,
(
struct
berval
*
)
&
slap_empty_bv
)
||
be_isupdate
(
op
->
o_bd
,
&
op
->
o_ndn
)
)
{
p
=
(
Entry
*
)
&
slap_entry_root
;
...
...
servers/slapd/back-ldbm/delete.c
View file @
fcc59c64
...
...
@@ -84,9 +84,6 @@ ldbm_back_delete(
}
/* check entry for "entry" acl */
#ifdef LDAP_CACHING
if
(
!
op
->
o_caching_on
)
{
#endif
/* LDAP_CACHING */
if
(
!
access_allowed
(
op
,
e
,
entry
,
NULL
,
ACL_WRITE
,
NULL
)
)
{
...
...
@@ -226,9 +223,6 @@ ldbm_back_delete(
}
}
}
#ifdef LDAP_CACHING
}
#endif
/* LDAP_CACHING */
/* delete from dn2id mapping */
if
(
dn2id_delete
(
op
->
o_bd
,
&
e
->
e_nname
,
e
->
e_id
)
!=
0
)
{
...
...
servers/slapd/back-ldbm/modify.c
View file @
fcc59c64
...
...
@@ -209,16 +209,7 @@ int ldbm_modify_internal(
}
/* check that the entry still obeys the schema */
#ifndef LDAP_CACHING
rc
=
entry_schema_check
(
op
->
o_bd
,
e
,
save_attrs
,
text
,
textbuf
,
textlen
);
#else
/* LDAP_CACHING */
if
(
!
op
->
o_caching_on
)
{
rc
=
entry_schema_check
(
op
->
o_bd
,
e
,
save_attrs
,
text
,
textbuf
,
textlen
);
}
else
{
rc
=
LDAP_SUCCESS
;
}
#endif
/* LDAP_CACHING */
if
(
rc
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
...
...
@@ -358,11 +349,7 @@ ldbm_back_modify(
#endif
}
#ifndef LDAP_CACHING
if
(
!
manageDSAit
&&
is_entry_referral
(
e
)
)
#else
/* LDAP_CACHING */
if
(
!
op
->
o_caching_on
&&
!
manageDSAit
&&
is_entry_referral
(
e
)
)
#endif
/* LDAP_CACHING */
{
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
...
...
servers/slapd/back-ldbm/search.c
View file @
fcc59c64
...
...
@@ -57,7 +57,6 @@ ldbm_back_search(
/* grab giant lock for reading */
ldap_pvt_thread_rdwr_rlock
(
&
li
->
li_giant_rwlock
);
#ifndef LDAP_CACHING
if
(
op
->
o_req_ndn
.
bv_len
==
0
)
{
/* DIT root special case */
e
=
(
Entry
*
)
&
slap_entry_root
;
...
...
@@ -65,25 +64,6 @@ ldbm_back_search(
/* need normalized dn below */
ber_dupbv
(
&
realbase
,
&
e
->
e_nname
);
#else
/* LDAP_CACHING */
if
(
op
->
o_caching_on
||
op
->
o_req_ndn
.
bv_len
==
0
)
{
if
(
op
->
o_req_ndn
.
bv_len
==
0
)
{
e
=
(
Entry
*
)
&
slap_entry_root
;
/* need normalized dn below */
ber_dupbv
(
&
realbase
,
&
e
->
e_nname
);
}
else
{
if
((
op
->
oq_search
.
rs_scope
==
LDAP_SCOPE_BASE
)
&&
(
e
=
dn2entry_r
(
op
->
o_bd
,
&
op
->
o_req_ndn
,
&
matched
)))
{
candidates
=
base_candidate
(
op
->
o_bd
,
e
);
cache_return_entry_r
(
&
li
->
li_cache
,
e
);
goto
searchit
;
}
cache_base_entry
.
e_nname
=
op
->
o_req_ndn
;
e
=
&
cache_base_entry
;
}
#endif
/* LDAP_CACHING */
candidates
=
search_candidates
(
op
,
e
,
op
->
oq_search
.
rs_filter
,
op
->
oq_search
.
rs_scope
,
op
->
oq_search
.
rs_deref
,
manageDSAit
||
get_domainScope
(
op
)
);
...
...
@@ -221,21 +201,10 @@ searchit:
Debug
(
LDAP_DEBUG_TRACE
,
"ldbm_search: no candidates
\n
"
,
0
,
0
,
0
);
#endif
#ifdef LDAP_CACHING
if
(
op
->
o_caching_on
)
{
ldap_pvt_thread_rdwr_runlock
(
&
li
->
li_giant_rwlock
);
}
#endif
/* LDAP_CACHING */
rs
->
sr_err
=
LDAP_SUCCESS
;
send_ldap_result
(
op
,
rs
);
#ifdef LDAP_CACHING
if
(
op
->
o_caching_on
)
{
ldap_pvt_thread_rdwr_rlock
(
&
li
->
li_giant_rwlock
);
}
#endif
/* LDAP_CACHING */
#ifdef LDAP_SYNCREPL
rc
=
LDAP_OTHER
;
#else
...
...
@@ -245,11 +214,7 @@ searchit:
}
/* if not root, get appropriate limits */
#ifndef LDAP_CACHING
if
(
be_isroot
(
op
->
o_bd
,
&
op
->
o_ndn
)
)
#else
/* LDAP_CACHING */
if
(
op
->
o_caching_on
||
be_isroot
(
op
->
o_bd
,
&
op
->
o_ndn
)
)
#endif
/* LDAP_CACHING */
{
/*
* FIXME: I'd consider this dangerous if someone
...
...
@@ -391,10 +356,6 @@ searchit:
}
#endif
#ifdef LDAP_CACHING
if
(
!
op
->
o_caching_on
)
{
#endif
/* LDAP_CACHING */
if
(
op
->
oq_search
.
rs_deref
&
LDAP_DEREF_SEARCHING
&&
is_entry_alias
(
e
)
)
{
Entry
*
matched
;
int
err
;
...
...
@@ -493,10 +454,6 @@ searchit:
goto
loop_continue
;
}
#ifdef LDAP_CACHING
}
#endif
/* LDAP_CACHING */
#ifdef LDAP_SYNCREPL
if
(
!
manageDSAit
&&
is_entry_glue
(
e
))
{
goto
loop_continue
;
...
...
@@ -537,22 +494,8 @@ searchit:
if
(
e
)
{
#ifdef LDAP_CACHING
if
(
op
->
o_caching_on
)
{
ldap_pvt_thread_rdwr_runlock
(
&
li
->
li_giant_rwlock
);
cache_return_entry_r
(
&
li
->
li_cache
,
e
);
}
#endif
/* LDAP_CACHING */
result
=
send_search_entry
(
op
,
rs
);
#ifdef LDAP_CACHING
if
(
op
->
o_caching_on
)
{
ldap_pvt_thread_rdwr_rlock
(
&
li
->
li_giant_rwlock
);
}
#endif
/* LDAP_CACHING */
switch
(
result
)
{
case
0
:
/* entry sent ok */
break
;
...
...
@@ -591,13 +534,7 @@ searchit:
loop_continue:
if
(
e
!=
NULL
)
{
/* free reader lock */
#ifndef LDAP_CACHING
cache_return_entry_r
(
&
li
->
li_cache
,
e
);
#else
/* LDAP_CACHING */
if
(
!
op
->
o_caching_on
)
{
cache_return_entry_r
(
&
li
->
li_cache
,
e
);
}
#endif
/* LDAP_CACHING */
}
ldap_pvt_thread_yield
();
...
...
servers/slapd/back-meta/cache-merge.c
View file @
fcc59c64
...
...
@@ -161,7 +161,6 @@ merge_entry(
op_tmp
.
o_tag
=
LDAP_REQ_ADD
;
op_tmp
.
o_protocol
=
LDAP_VERSION3
;
op_tmp
.
o_callback
=
&
cb
;
op_tmp
.
o_caching_on
=
0
;
op_tmp
.
o_time
=
slap_get_time
();
op_tmp
.
o_do_not_cache
=
1
;
...
...
servers/slapd/back-meta/cache-remove.c
View file @
fcc59c64
...
...
@@ -80,7 +80,6 @@ remove_query_data (
op_tmp
.
o_callback
=
&
cb
;
op_tmp
.
o_time
=
slap_get_time
();
op_tmp
.
o_do_not_cache
=
1
;
op_tmp
.
o_caching_on
=
0
;
op_tmp
.
o_req_dn
=
op
->
o_bd
->
be_suffix
[
0
];
op_tmp
.
o_req_ndn
=
op
->
o_bd
->
be_nsuffix
[
0
];
...
...
servers/slapd/back-meta/cache-search.c
View file @
fcc59c64
...
...
@@ -404,7 +404,6 @@ meta_back_cache_search(
op_tmp
.
o_req_dn
=
cachebase
;
op_tmp
.
o_req_ndn
=
ncachebase
;
op_tmp
.
o_caching_on
=
0
;
op_tmp
.
o_callback
=
&
cb
;
li
->
glue_be
->
be_search
(
&
op_tmp
,
rs
);
...
...
servers/slapd/slap.h
View file @
fcc59c64
...
...
@@ -1977,10 +1977,6 @@ typedef struct slap_op {
syncinfo_t
*
o_si
;
#endif
#ifdef LDAP_CACHING
char
o_caching_on
;
#endif
/*LDAP_CACHING */
#ifdef LDAP_SLAPI
void
*
o_pb
;
/* NS-SLAPI plugin */
void
*
o_extensions
;
/* NS-SLAPI plugin */
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment