Skip to content

Commit

Permalink
auto_fwd_resp_handler should forward resp->get_result_code (#497) (#498)
Browse files Browse the repository at this point in the history
* auto_fwd_resp_handler should forward resp->get_result_code (#497)

* auto_fwd_resp_handler should forward resp->get_result_code (#497)

---------

Co-authored-by: byronhe <[email protected]>
  • Loading branch information
byronhe and byronhe authored Apr 18, 2024
1 parent 51b07ae commit d195630
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/handle_user_cmd.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,20 @@ void raft_server::auto_fwd_resp_handler( ptr<cmd_result<ptr<buffer>>> presult,
{
ptr<buffer> resp_ctx(nullptr);
ptr<std::exception> perr;
cmd_result_code code = cmd_result_code::OK;

if (err) {
perr = err;
code = cmd_result_code::FAILED;
} else {
if (resp->get_accepted()) {
resp_ctx = resp->get_ctx();
presult->accept();
}
code = resp->get_result_code();
}

presult->set_result(resp_ctx, perr);
presult->set_result(resp_ctx, perr, code);
auto_fwd_release_rpc_cli(cur_pkg, rpc_cli);
}

Expand Down

0 comments on commit d195630

Please sign in to comment.