aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/net/levin_protocol_handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/include/net/levin_protocol_handler.h')
-rw-r--r--contrib/epee/include/net/levin_protocol_handler.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/contrib/epee/include/net/levin_protocol_handler.h b/contrib/epee/include/net/levin_protocol_handler.h
index 791766762..c510cfd79 100644
--- a/contrib/epee/include/net/levin_protocol_handler.h
+++ b/contrib/epee/include/net/levin_protocol_handler.h
@@ -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;
}