Verified Commit 68cf2ee4 authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

scord-ctl: Add handler for deploy_adhoc_storage RPC

parent d92fbfdd
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include <logger/logger.hpp>
#include <net/request.hpp>
#include <net/client.hpp>
#include "rpc_handlers.hpp"

struct remote_procedure {
@@ -59,4 +60,27 @@ ping(const scord::network::request& req) {
    req.respond(resp);
}

void
deploy_adhoc_storage(const scord::network::request& req) {

    using scord::network::generic_response;
    using scord::network::get_address;

    const auto rpc_id = remote_procedure::new_id();

    LOGGER_INFO("rpc id: {} name: {} from: {} => "
                "body: {{}}",
                rpc_id, std::quoted(__FUNCTION__),
                std::quoted(get_address(req)));

    const auto resp = generic_response{rpc_id, scord::error_code::success};

    LOGGER_INFO("rpc id: {} name: {} to: {} <= "
                "body: {{retval: {}}}",
                rpc_id, std::quoted(__FUNCTION__),
                std::quoted(get_address(req)), scord::error_code::success);

    req.respond(resp);
}

} // namespace scord_ctl::network::handlers
+3 −0
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ namespace scord_ctl::network::handlers {
void
ping(const scord::network::request& req);

void
deploy_adhoc_storage(const scord::network::request& req);

} // namespace scord_ctl::network::handlers

#endif // SCORD_CTL_RPC_HANDLERS_HPP