forked from boostorg/beast
message::prepare_payload replaces message::prepare (API Change):
Actions Required: * Change calls to msg.prepare to msg.prepare_payload. For messages with a user-defined Fields, provide the function prepare_payload_impl in the fields type according to the Fields requirements.
This commit is contained in:
@@ -320,7 +320,7 @@ void do_server_head(
|
||||
// set of headers that would be sent for a GET request,
|
||||
// including the Content-Length, except for the body.
|
||||
res.result(status::ok);
|
||||
res.content_length(payload.size());
|
||||
res.set(field::content_length, payload.size());
|
||||
|
||||
// For GET requests, we include the body
|
||||
if(req.method() == verb::get)
|
||||
|
||||
@@ -64,7 +64,7 @@ int main()
|
||||
req.set(http::field::host, host + ":" +
|
||||
boost::lexical_cast<std::string>(sock.remote_endpoint().port()));
|
||||
req.set(http::field::user_agent, "Beast");
|
||||
req.prepare();
|
||||
req.prepare_payload();
|
||||
|
||||
// Write the HTTP request to the remote host
|
||||
http::write(stream, req, ec);
|
||||
|
||||
@@ -55,7 +55,7 @@ int main()
|
||||
req.set(http::field::host, host + ":" +
|
||||
boost::lexical_cast<std::string>(sock.remote_endpoint().port()));
|
||||
req.set(http::field::user_agent, "Beast");
|
||||
req.prepare();
|
||||
req.prepare_payload();
|
||||
|
||||
// Write the HTTP request to the remote host
|
||||
http::write(sock, req, ec);
|
||||
|
||||
@@ -225,7 +225,7 @@ private:
|
||||
res.set(beast::http::field::server, server_);
|
||||
res.set(beast::http::field::content_type, "text/html");
|
||||
res.body = "The file was not found"; // VFALCO append rel_path
|
||||
res.prepare();
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ private:
|
||||
res.set(beast::http::field::server, server_);
|
||||
res.set(beast::http::field::content_type, mime_type(full_path));
|
||||
res.body = full_path;
|
||||
res.prepare();
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ protected:
|
||||
res.set(beast::http::field::server, server_name_);
|
||||
res.set(beast::http::field::content_type, "text/html");
|
||||
res.body = "Bad request";
|
||||
res.prepare();
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user