diff options
author | Lee Clagett <code@leeclagett.com> | 2019-11-17 06:06:10 +0000 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2020-04-03 01:56:17 +0000 |
commit | da9915746219482c25b96406d475c6fde9b02a31 (patch) | |
tree | 5b1c6be33c9511dc6af48b63d5f87877b9bd06ae /src/rpc/message.h | |
parent | Merge pull request #6470 (diff) | |
download | monero-da9915746219482c25b96406d475c6fde9b02a31.tar.xz |
Use byte_slice for sending zmq messages - removes data copy within zmq
Diffstat (limited to 'src/rpc/message.h')
-rw-r--r-- | src/rpc/message.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rpc/message.h b/src/rpc/message.h index 4cbc84fe4..8156e232c 100644 --- a/src/rpc/message.h +++ b/src/rpc/message.h @@ -33,6 +33,7 @@ #include <rapidjson/writer.h> #include <string> +#include "byte_slice.h" #include "rpc/message_data_structs.h" namespace cryptonote @@ -85,8 +86,8 @@ namespace rpc cryptonote::rpc::error getError(); - static std::string getRequest(const std::string& request, const Message& message, unsigned id); - static std::string getResponse(const Message& message, const rapidjson::Value& id); + static epee::byte_slice getRequest(const std::string& request, const Message& message, unsigned id); + static epee::byte_slice getResponse(const Message& message, const rapidjson::Value& id); private: FullMessage() = default; @@ -99,10 +100,10 @@ namespace rpc // convenience functions for bad input - std::string BAD_REQUEST(const std::string& request); - std::string BAD_REQUEST(const std::string& request, const rapidjson::Value& id); + epee::byte_slice BAD_REQUEST(const std::string& request); + epee::byte_slice BAD_REQUEST(const std::string& request, const rapidjson::Value& id); - std::string BAD_JSON(const std::string& error_details); + epee::byte_slice BAD_JSON(const std::string& error_details); } // namespace rpc |