mirror of
https://github.com/monero-project/monero.git
synced 2025-05-05 12:25:04 -04:00
Change epee binary output from std::stringstream to byte_stream
This commit is contained in:
parent
b7425c14c8
commit
7414e2bac1
23 changed files with 126 additions and 106 deletions
|
@ -56,13 +56,13 @@ namespace
|
|||
{
|
||||
}
|
||||
|
||||
virtual int invoke(int command, const epee::span<const uint8_t> in_buff, std::string& buff_out, test_levin_connection_context& context)
|
||||
virtual int invoke(int command, const epee::span<const uint8_t> in_buff, epee::byte_slice& 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 = std::string((const char*)in_buff.data(), in_buff.size());
|
||||
buff_out = m_invoke_out_buf;
|
||||
buff_out = m_invoke_out_buf.clone();
|
||||
return m_return_code;
|
||||
}
|
||||
|
||||
|
@ -102,8 +102,7 @@ namespace
|
|||
int return_code() const { return m_return_code; }
|
||||
void return_code(int v) { m_return_code = v; }
|
||||
|
||||
const std::string& invoke_out_buf() const { return m_invoke_out_buf; }
|
||||
void invoke_out_buf(const std::string& v) { m_invoke_out_buf = v; }
|
||||
void invoke_out_buf(std::string v) { m_invoke_out_buf = epee::byte_slice{std::move(v)}; }
|
||||
|
||||
int last_command() const { return m_last_command; }
|
||||
const std::string& last_in_buf() const { return m_last_in_buf; }
|
||||
|
@ -118,7 +117,7 @@ namespace
|
|||
boost::mutex m_mutex;
|
||||
|
||||
int m_return_code;
|
||||
std::string m_invoke_out_buf;
|
||||
epee::byte_slice m_invoke_out_buf;
|
||||
|
||||
int m_last_command;
|
||||
std::string m_last_in_buf;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue