diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-12-06 18:04:33 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-12-23 16:46:07 +0000 |
commit | 85665003a7d9e013b1d7df5578dbf47ddf81b236 (patch) | |
tree | e5a3497f5ace88b3a671e4068d7e5d3a432b77f6 /tests/fuzz/levin.cpp | |
parent | Merge pull request #4927 (diff) | |
download | monero-85665003a7d9e013b1d7df5578dbf47ddf81b236.tar.xz |
epee: better network buffer data structure
avoids pointless allocs and memcpy
Diffstat (limited to 'tests/fuzz/levin.cpp')
-rw-r--r-- | tests/fuzz/levin.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/fuzz/levin.cpp b/tests/fuzz/levin.cpp index d0c5803f5..573abd1d3 100644 --- a/tests/fuzz/levin.cpp +++ b/tests/fuzz/levin.cpp @@ -65,22 +65,22 @@ namespace { } - virtual int invoke(int command, const std::string& in_buff, std::string& buff_out, test_levin_connection_context& context) + virtual int invoke(int command, const epee::span<const uint8_t> in_buff, std::string& buff_out, test_levin_connection_context& context) { m_invoke_counter.inc(); boost::unique_lock<boost::mutex> lock(m_mutex); m_last_command = command; - m_last_in_buf = in_buff; + m_last_in_buf = std::string((const char*)in_buff.data(), in_buff.size()); buff_out = m_invoke_out_buf; return m_return_code; } - virtual int notify(int command, const std::string& in_buff, test_levin_connection_context& context) + virtual int notify(int command, const epee::span<const uint8_t> in_buff, test_levin_connection_context& context) { m_notify_counter.inc(); boost::unique_lock<boost::mutex> lock(m_mutex); m_last_command = command; - m_last_in_buf = in_buff; + m_last_in_buf = std::string((const char*)in_buff.data(), in_buff.size()); return m_return_code; } |