mirror of
https://github.com/monero-project/monero.git
synced 2025-05-25 16:40:52 -04:00
Add ref-counted buffer byte_slice. Currently used for sending TCP data.
This commit is contained in:
parent
cdfa2e58df
commit
bdfc63ae4d
13 changed files with 882 additions and 153 deletions
|
@ -157,10 +157,9 @@ namespace levin
|
|||
m_current_head.m_return_code = m_config.m_pcommands_handler->invoke(m_current_head.m_command, buff_to_invoke, return_buff, m_conn_context);
|
||||
m_current_head.m_cb = return_buff.size();
|
||||
m_current_head.m_have_to_return_data = false;
|
||||
std::string send_buff((const char*)&m_current_head, sizeof(m_current_head));
|
||||
send_buff += return_buff;
|
||||
|
||||
if(!m_psnd_hndlr->do_send(send_buff.data(), send_buff.size()))
|
||||
return_buff.insert(0, (const char*)&m_current_head, sizeof(m_current_head));
|
||||
if(!m_psnd_hndlr->do_send(byte_slice{std::move(return_buff)}))
|
||||
return false;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue