diff options
author | Lee Clagett <code@leeclagett.com> | 2019-05-11 11:38:35 -0400 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2019-07-16 16:30:35 +0000 |
commit | bdfc63ae4ddc52e2dece2a031a91509418206cb0 (patch) | |
tree | 495b13c21a9be88fd2aab8f4d188f115053d12c5 /contrib/epee/include/net/http_protocol_handler.inl | |
parent | Merge pull request #5827 (diff) | |
download | monero-bdfc63ae4ddc52e2dece2a031a91509418206cb0.tar.xz |
Add ref-counted buffer byte_slice. Currently used for sending TCP data.
Diffstat (limited to 'contrib/epee/include/net/http_protocol_handler.inl')
-rw-r--r-- | contrib/epee/include/net/http_protocol_handler.inl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/epee/include/net/http_protocol_handler.inl b/contrib/epee/include/net/http_protocol_handler.inl index 790d0f3b1..19bdf4ff0 100644 --- a/contrib/epee/include/net/http_protocol_handler.inl +++ b/contrib/epee/include/net/http_protocol_handler.inl @@ -591,11 +591,12 @@ namespace net_utils std::string response_data = get_response_header(response); //LOG_PRINT_L0("HTTP_SEND: << \r\n" << response_data + response.m_body); - LOG_PRINT_L3("HTTP_RESPONSE_HEAD: << \r\n" << response_data); - - m_psnd_hndlr->do_send((void*)response_data.data(), response_data.size()); + LOG_PRINT_L3("HTTP_RESPONSE_HEAD: << \r\n" << response_data); + if ((response.m_body.size() && (query_info.m_http_method != http::http_method_head)) || (query_info.m_http_method == http::http_method_options)) - m_psnd_hndlr->do_send((void*)response.m_body.data(), response.m_body.size()); + response_data += response.m_body; + + m_psnd_hndlr->do_send(byte_slice{std::move(response_data)}); m_psnd_hndlr->send_done(); return res; } |