Hello there, I'm currently building my own, specialized http-server based on the http-server example. I experience crashes for certain types of replies. Here's something I really do not understand: In connection.cpp, after request_parser_.parse() finished and result == true, there is this line: boost::asio::async_write(socket_, reply_.to_buffers(), boost::bind(&connection::handle_write, shared_from_this(), boost::asio::placeholders::error)); It's the last user-code in the stacktrace of the crash that I frequently experience. What bothers me is the reply_.to_buffers() function. It looks like this: std::vectorboost::asio::const_buffer reply::to_buffers() { std::vectorboost::asio::const_buffer buffers; buffers.push_back(status_strings::to_buffer(status)); for (std::size_t i = 0; i < headers.size(); ++i) { header& h = headers[i]; buffers.push_back(boost::asio::buffer(h.name)); buffers.push_back(boost::asio::buffer(misc_strings::name_value_separator)); buffers.push_back(boost::asio::buffer(h.value)); buffers.push_back(boost::asio::buffer(misc_strings::crlf)); } buffers.push_back(boost::asio::buffer(misc_strings::crlf)); buffers.push_back(boost::asio::buffer(content)); return buffers; } How can this even work? It adds temporaries (the misc_strings are const char[]s) to a const_buffer-vector and reads them later. Even the references to h.name, etc. seem invalid to me, since the io is asynchronous and there's no guarantee that they don't change. IMHO the whole content needs to be COPIED to new buffers and then, after the async_write finished, deleted. Am I missing something? Was the author of this example not aware of the const_buffer's ownership policy (i.e. it is *not* owner of the data)? I've spent hours and hours in debugging now, but I just can't figure out where it goes wrong. You can see the stacktrace here: http://mandrill.fuxx0r.net/c++/paste:7702 Kind regards, Daniel Albuschat -- eat(this); // delicious suicide