On Sun, Jul 2, 2017 at 6:43 PM, Niall Douglas via Boost
char buffer[16384]; // no need to explicitly limit header + body
// Create a HTTP request parsing view of char[16384] http::request_parserhttp::string_body parser(buffer);
// Read enough data to parse the request char *p = buffer; do { p += asio::read(socket, asio::buffer(p, buffer + sizeof(buffer) - p)); } while(!parser.has_body(p - buffer)); do_request(parser.get(), ec);
// Use any spill at the end memcpy(buffer, buffer + parser.size_bytes(), p - (buffer + parser.size_bytes())); p = buffer;
You're asking for beast::http::parser to not use
// These prepend additional gather buffers for the headers res.result( http::status::ok ); res.set( http::field::server, BEAST_VERSION_STRING ); res.set( http::field::content_type, "image/bmp" ); res.set( http::field::content_length, data.size() );
// Tell ASIO to send the response by gathering all the buffers asio::write(socket, boost::make_iterator_range(res.begin(), res.end()));
This is in no way equivalent to what Beast does now, I suggest you
study BodyReader and http::serializer.
Still, it sounds like again you are simply asking that
http::serializer not use