* HTTPServer : keep response data for async_write()

This commit is contained in:
hagen 2016-08-26 14:00:00 +00:00
parent 205b61e4cf
commit 26440d94f1
2 changed files with 3 additions and 2 deletions

View file

@ -762,8 +762,8 @@ namespace http {
reply.add_header("Content-Type", "text/html");
reply.body = content;
std::string res = reply.to_string();
boost::asio::async_write (*m_Socket, boost::asio::buffer(res),
m_SendBuffer = reply.to_string();
boost::asio::async_write (*m_Socket, boost::asio::buffer(m_SendBuffer),
std::bind (&HTTPConnection::Terminate, shared_from_this (), std::placeholders::_1));
}