Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
bc65dc49
Commit
bc65dc49
authored
Jan 25, 2016
by
Willem Thiart
Browse files
Applylog now takes raft_entry_t
Breaking change.
parent
794628d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/raft.h
View file @
bc65dc49
...
...
@@ -201,16 +201,14 @@ typedef void (
/** Callback for applying this log entry to the state machine.
* @param[in] raft The Raft server making this callback
* @param[in] user_data User data that is passed from Raft server
* @param[in] data Data to be applied to the log
* @param[in] len Length in bytes of data to be applied
* @param[in] ety Log entry to be applied
* @return 0 on success */
typedef
int
(
*
func_applylog_f
)
(
raft_server_t
*
raft
,
void
*
user_data
,
const
unsigned
char
*
log_data
,
const
int
log_len
raft_entry_t
*
ety
);
/** Callback for saving who we voted for to disk.
...
...
src/raft_server.c
View file @
bc65dc49
...
...
@@ -592,7 +592,7 @@ int raft_apply_entry(raft_server_t* me_)
me
->
last_applied_idx
++
;
if
(
me
->
cb
.
applylog
)
me
->
cb
.
applylog
(
me_
,
me
->
udata
,
e
->
data
.
buf
,
e
->
data
.
len
);
me
->
cb
.
applylog
(
me_
,
me
->
udata
,
e
);
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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