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
1a349907
Commit
1a349907
authored
Dec 28, 2001
by
Pierangelo Masarati
Browse files
cached entries are deleted if volatile; small improvements
parent
c8335e7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-monitor/cache.c
View file @
1a349907
...
...
@@ -74,13 +74,18 @@ monitor_cache_dup(
struct
monitorcache
*
cc1
=
(
struct
monitorcache
*
)
c1
;
struct
monitorcache
*
cc2
=
(
struct
monitorcache
*
)
c2
;
int
d
=
cc1
->
mc_ndn
->
bv_len
-
cc2
->
mc_ndn
->
bv_len
;
int
cmp
;
/*
* case sensitive, because the dn MUST be normalized
*/
cmp
=
d
!=
0
?
d
:
strcmp
(
cc1
->
mc_ndn
->
bv_val
,
cc2
->
mc_ndn
->
bv_val
);
#if 0
int cmp = monitor_cache_cmp( c1, c2 );
#else
int
d
=
cc1
->
mc_ndn
->
bv_len
-
cc2
->
mc_ndn
->
bv_len
;
int
cmp
=
d
!=
0
?
d
:
strcmp
(
cc1
->
mc_ndn
->
bv_val
,
cc2
->
mc_ndn
->
bv_val
);
#endif
return
cmp
==
0
?
-
1
:
0
;
}
...
...
@@ -203,16 +208,19 @@ monitor_cache_dn2entry(
}
/* try with parent/ancestors */
if
(
ndn
&&
ndn
->
bv_len
)
{
if
(
ndn
->
bv_len
)
{
p_ndn
.
bv_val
=
dn_parent
(
NULL
,
ndn
->
bv_val
);
}
if
(
p_ndn
.
bv_val
==
NULL
)
{
p_ndn
.
bv_val
=
""
;
p_ndn
.
bv_len
=
0
;
}
else
{
p_ndn
.
bv_len
=
ndn
->
bv_len
-
(
ber_len_t
)
(
p_ndn
.
bv_val
-
ndn
->
bv_val
);
}
rc
=
monitor_cache_dn2entry
(
mi
,
&
p_ndn
,
&
e_parent
,
matched
);
if
(
rc
||
e_parent
==
NULL
)
{
return
(
-
1
);
...
...
@@ -253,15 +261,26 @@ monitor_cache_release(
mp
=
(
struct
monitorentrypriv
*
)
e
->
e_private
;
if
(
mp
->
mp_flags
&
MONITOR_F_VOLATILE
)
{
struct
monitorcache
*
mc
,
tmp_mc
;
/* volatile entries do not return to cache */
ldap_pvt_thread_mutex_lock
(
&
mi
->
mi_cache_mutex
);
tmp_mc
.
mc_ndn
=
&
e
->
e_nname
;
mc
=
avl_delete
(
&
mi
->
mi_cache
,
(
caddr_t
)
&
tmp_mc
,
monitor_cache_cmp
);
ldap_pvt_thread_mutex_unlock
(
&
mi
->
mi_cache_mutex
);
ch_free
(
mc
);
ldap_pvt_thread_mutex_destroy
(
&
mp
->
mp_mutex
);
ch_free
(
mp
);
e
->
e_private
=
NULL
;
entry_free
(
e
);
return
(
0
);
}
ldap_pvt_thread_mutex_unlock
(
&
mp
->
mp_mutex
);
return
(
0
);
}
servers/slapd/back-monitor/conn.c
View file @
1a349907
...
...
@@ -399,22 +399,32 @@ monitor_subsys_conn_create(
*
ep
=
e
;
}
else
{
char
**
values
;
struct
berval
rdn
;
char
**
values
=
NULL
;
unsigned
long
connid
;
/* create exactly the required entry */
#if 0
struct berval rdn;
/*
* FIXME: we can pass the entire DN
* only if rdn_attrs does not complain.
*/
if ( dnExtractRdn( ndn, &rdn ) != LDAP_SUCCESS ) {
return( -1 );
}
if ( rdn_attrs( rdn.bv_val, NULL, &values ) != LDAP_SUCCESS ) {
free( rdn.bv_val );
return( -1 );
}
free( rdn.bv_val );
#else
if
(
rdn_attrs
(
ndn
->
bv_val
,
NULL
,
&
values
)
!=
LDAP_SUCCESS
)
{
return
(
-
1
);
}
#endif
assert
(
values
);
assert
(
values
[
0
]
);
...
...
servers/slapd/back-monitor/log.c
View file @
1a349907
...
...
@@ -148,26 +148,8 @@ monitor_subsys_log_modify(
Modification
*
mod
=
&
ml
->
sml_mod
;
/*
*
O
perational attributes
*
accept all o
perational attributes
*/
#if 0
if ( mod->sm_desc == slap_schema.si_ad_modifyTimestamp
|| mod->sm_desc == slap_schema.si_ad_modifiersName ) {
( void ) attr_delete( &e->e_attrs, mod->sm_desc );
rc = attr_merge( e, mod->sm_desc, mod->sm_bvalues );
if ( rc != 0 ) {
rc = LDAP_OTHER;
break;
}
continue;
/*
* unhandled operational attributes
*/
} else if ( is_at_operational( mod->sm_desc->ad_type ) ) {
continue;
#else
if
(
is_at_operational
(
mod
->
sm_desc
->
ad_type
)
)
{
(
void
)
attr_delete
(
&
e
->
e_attrs
,
mod
->
sm_desc
);
rc
=
attr_merge
(
e
,
mod
->
sm_desc
,
mod
->
sm_bvalues
);
...
...
@@ -177,7 +159,6 @@ monitor_subsys_log_modify(
}
continue
;
#endif
/*
* only the monitor description attribute can be modified
*/
...
...
@@ -234,7 +215,7 @@ monitor_subsys_log_modify(
ldap_syslog
=
newlevel
;
#if 0
#if 0
/* debug rather than log */
slap_debug = newlevel;
lutil_set_debug_level( "slapd", slap_debug );
ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &slap_debug);
...
...
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