28 Dec
2011
28 Dec
'11
7:20 a.m.
Please, don't top-tpost.
"content", etc are std::wstring objects.
Are you sure they outlive the async operation (eg. aren't they local objects)?
std::vectorboost::asio::const_buffer reply::to_buffers() { std::vectorboost::asio::const_buffer buffers;
buffers.push_back(status_strings::to_buffer(status)); buffers.push_back(boost::asio::buffer(misc_strings::crlf)); buffers.push_back(boost::asio::buffer(content));
return buffers; } and ... request_handler_.handle_request(req, reply_);
boost::asio::async_write(socket_, reply_.to_buffers(), strand_.wrap( boost::bind(&connection::handle_write, shared_from_this(), _1))
Check also that you don't call async_write() when another async_write() to the same socket is in progress.