Remove payload copy in all outgoing p2p messages

This commit is contained in:
Lee Clagett 2021-01-19 02:22:32 +00:00
parent e45619e61e
commit 679d05567d
21 changed files with 325 additions and 231 deletions

View file

@ -34,6 +34,7 @@
namespace epee
{
class byte_slice;
class byte_stream;
namespace serialization
{
/************************************************************************/
@ -83,8 +84,13 @@ namespace epee
//-------------------------------------------------------------------------------
bool store_to_binary(byte_slice& target, std::size_t initial_buffer_size = 8192);
bool load_from_binary(const epee::span<const uint8_t> target, const limits_t *limits = NULL);
bool load_from_binary(const std::string& target, const limits_t *limits = NULL);
bool store_to_binary(byte_stream& ss);
bool load_from_binary(const epee::span<const uint8_t> target, const limits_t *limits = nullptr);
bool load_from_binary(const std::string& target, const limits_t *limits = nullptr)
{
return load_from_binary(epee::strspan<uint8_t>(target), limits);
}
template<class trace_policy>
bool dump_as_xml(std::string& targetObj, const std::string& root_name = "");
bool dump_as_json(std::string& targetObj, size_t indent = 0, bool insert_newlines = true);