Commit bc65dc49 authored by Willem Thiart's avatar Willem Thiart
Browse files

Applylog now takes raft_entry_t

Breaking change.
parent 794628d4
...@@ -201,16 +201,14 @@ typedef void ( ...@@ -201,16 +201,14 @@ typedef void (
/** Callback for applying this log entry to the state machine. /** Callback for applying this log entry to the state machine.
* @param[in] raft The Raft server making this callback * @param[in] raft The Raft server making this callback
* @param[in] user_data User data that is passed from Raft server * @param[in] user_data User data that is passed from Raft server
* @param[in] data Data to be applied to the log * @param[in] ety Log entry to be applied
* @param[in] len Length in bytes of data to be applied
* @return 0 on success */ * @return 0 on success */
typedef int ( typedef int (
*func_applylog_f *func_applylog_f
) ( ) (
raft_server_t* raft, raft_server_t* raft,
void *user_data, void *user_data,
const unsigned char *log_data, raft_entry_t* ety
const int log_len
); );
/** Callback for saving who we voted for to disk. /** Callback for saving who we voted for to disk.
......
...@@ -592,7 +592,7 @@ int raft_apply_entry(raft_server_t* me_) ...@@ -592,7 +592,7 @@ int raft_apply_entry(raft_server_t* me_)
me->last_applied_idx++; me->last_applied_idx++;
if (me->cb.applylog) 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; return 0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment