Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Jaak Ristioja
OpenLDAP
Commits
99f2d0b4
Commit
99f2d0b4
authored
20 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Let slap_get_commit_csn return the current CSN as well
parent
33bb0647
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
servers/slapd/ctxcsn.c
+10
-4
10 additions, 4 deletions
servers/slapd/ctxcsn.c
servers/slapd/proto-slap.h
+2
-1
2 additions, 1 deletion
servers/slapd/proto-slap.h
with
12 additions
and
5 deletions
servers/slapd/ctxcsn.c
+
10
−
4
View file @
99f2d0b4
...
...
@@ -30,18 +30,24 @@ const struct berval slap_ldapsync_bv = BER_BVC("ldapsync");
const
struct
berval
slap_ldapsync_cn_bv
=
BER_BVC
(
"cn=ldapsync"
);
void
slap_get_commit_csn
(
Operation
*
op
,
struct
berval
*
csn
)
slap_get_commit_csn
(
Operation
*
op
,
struct
berval
*
maxcsn
,
struct
berval
*
curcsn
)
{
struct
slap_csn_entry
*
csne
,
*
committed_csne
=
NULL
;
int
i
=
0
;
csn
->
bv_val
=
NULL
;
csn
->
bv_len
=
0
;
if
(
maxcsn
)
{
BER_BVZERO
(
maxcsn
);
}
ldap_pvt_thread_mutex_lock
(
op
->
o_bd
->
be_pcl_mutexp
);
LDAP_TAILQ_FOREACH
(
csne
,
op
->
o_bd
->
be_pending_csn_list
,
ce_csn_link
)
{
if
(
csne
->
ce_opid
==
op
->
o_opid
&&
csne
->
ce_connid
==
op
->
o_connid
)
{
if
(
curcsn
)
*
curcsn
=
csne
->
ce_csn
;
csne
->
ce_state
=
SLAP_CSN_COMMIT
;
break
;
}
...
...
@@ -52,7 +58,7 @@ slap_get_commit_csn( Operation *op, struct berval *csn )
if
(
csne
->
ce_state
==
SLAP_CSN_PENDING
)
break
;
}
if
(
committed_csne
)
ber_dupbv_x
(
csn
,
&
committed_csne
->
ce_csn
,
op
->
o_tmpmemctx
)
;
if
(
committed_csne
&&
maxcsn
)
*
maxcsn
=
committed_csne
->
ce_csn
;
ldap_pvt_thread_mutex_unlock
(
op
->
o_bd
->
be_pcl_mutexp
);
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/proto-slap.h
+
2
−
1
View file @
99f2d0b4
...
...
@@ -482,7 +482,8 @@ LDAP_SLAPD_F (ContentRule *) cr_bvfind LDAP_P((
LDAP_SLAPD_V
(
const
struct
berval
)
slap_ldapsync_bv
;
LDAP_SLAPD_V
(
const
struct
berval
)
slap_ldapsync_cn_bv
;
LDAP_SLAPD_F
(
void
)
slap_get_commit_csn
LDAP_P
((
Operation
*
,
struct
berval
*
));
LDAP_SLAPD_F
(
void
)
slap_get_commit_csn
LDAP_P
((
Operation
*
,
struct
berval
*
maxcsn
,
struct
berval
*
curcsn
));
LDAP_SLAPD_F
(
void
)
slap_rewind_commit_csn
LDAP_P
((
Operation
*
));
LDAP_SLAPD_F
(
void
)
slap_graduate_commit_csn
LDAP_P
((
Operation
*
));
LDAP_SLAPD_F
(
Entry
*
)
slap_create_context_csn_entry
LDAP_P
((
Backend
*
,
struct
berval
*
));
...
...
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