Updating beast API.
This commit is contained in:
parent
37abbdae6d
commit
70e9d8a99c
4 changed files with 14 additions and 13 deletions
|
@ -25,8 +25,8 @@ public:
|
|||
{
|
||||
std::stringstream ostream;
|
||||
boost::property_tree::write_json (ostream, request);
|
||||
req.method = "POST";
|
||||
req.url = "/";
|
||||
req.method ("POST");
|
||||
req.target ("/");
|
||||
req.version = 11;
|
||||
ostream.flush ();
|
||||
req.body = ostream.str ();
|
||||
|
@ -71,7 +71,7 @@ public:
|
|||
boost::property_tree::ptree const & request;
|
||||
boost::asio::ip::tcp::socket sock;
|
||||
boost::property_tree::ptree json;
|
||||
beast::streambuf sb;
|
||||
beast::flat_buffer sb;
|
||||
beast::http::request<beast::http::string_body> req;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
int status;
|
||||
|
|
|
@ -1110,8 +1110,8 @@ warmed_up (0)
|
|||
if (!ec)
|
||||
{
|
||||
auto req (std::make_shared <beast::http::request<beast::http::string_body>> ());
|
||||
req->method = "POST";
|
||||
req->url = *target;
|
||||
req->method ("POST");
|
||||
req->target (*target);
|
||||
req->version = 11;
|
||||
req->fields.replace("Host", address);
|
||||
req->body = *body;
|
||||
|
@ -1120,7 +1120,7 @@ warmed_up (0)
|
|||
{
|
||||
if (!ec)
|
||||
{
|
||||
auto sb (std::make_shared <beast::streambuf> ());
|
||||
auto sb (std::make_shared <beast::flat_buffer> ());
|
||||
auto resp (std::make_shared <beast::http::response <beast::http::string_body>> ());
|
||||
beast::http::async_read (*sock, *sb, *resp, [node_l, sb, resp, sock, address, port] (boost::system::error_code & ec)
|
||||
{
|
||||
|
@ -1830,7 +1830,7 @@ socket (service_a)
|
|||
}
|
||||
boost::asio::ip::address address;
|
||||
uint16_t port;
|
||||
beast::streambuf buffer;
|
||||
beast::flat_buffer buffer;
|
||||
beast::http::response <beast::http::string_body> response;
|
||||
boost::asio::ip::tcp::socket socket;
|
||||
};
|
||||
|
@ -1875,8 +1875,8 @@ void start ()
|
|||
request_string = ostream.str ();
|
||||
}
|
||||
beast::http::request <beast::http::string_body> request;
|
||||
request.method = "POST";
|
||||
request.url = "/";
|
||||
request.method ("POST");
|
||||
request.target ("/");
|
||||
request.version = 11;
|
||||
request.body = request_string;
|
||||
beast::http::prepare (request);
|
||||
|
@ -1946,8 +1946,8 @@ void stop ()
|
|||
request_string = ostream.str ();
|
||||
}
|
||||
beast::http::request <beast::http::string_body> request;
|
||||
request.method = "POST";
|
||||
request.url = "/";
|
||||
request.method ("POST");
|
||||
request.target ("/");
|
||||
request.version = 11;
|
||||
request.body = request_string;
|
||||
beast::http::prepare (request);
|
||||
|
|
|
@ -2042,7 +2042,7 @@ void rai::rpc_connection::parse_connection ()
|
|||
{
|
||||
});
|
||||
});
|
||||
if (this_l->request.method == "POST")
|
||||
if (this_l->request.method () == "POST")
|
||||
{
|
||||
auto handler (std::make_shared <rai::rpc_handler> (*this_l->node, this_l->rpc, this_l->request.body, response_handler));
|
||||
handler->process_request ();
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <rai/utility.hpp>
|
||||
|
||||
#include <beast/http.hpp>
|
||||
#include <beast/core/flat_buffer.hpp>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
@ -62,7 +63,7 @@ public:
|
|||
std::shared_ptr <rai::node> node;
|
||||
rai::rpc & rpc;
|
||||
boost::asio::ip::tcp::socket socket;
|
||||
beast::streambuf buffer;
|
||||
beast::flat_buffer buffer;
|
||||
beast::http::request <beast::http::string_body> request;
|
||||
beast::http::response <beast::http::string_body> res;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue