Refactor header and message constructors:

fix #581

* request and response headers now have convenience
  constructors so important fields like method, target,
  result, and version may be set upon construction.

Actions Required:

* Evaluate each message constructor call site and
  adjust the constructor argument list as needed.
This commit is contained in:
Vinnie Falco
2017-07-20 08:15:29 -07:00
parent 2ee088de5f
commit b0e52dd246
11 changed files with 487 additions and 210 deletions
+1 -1
View File
@@ -264,7 +264,7 @@ protected:
// We construct the dynamic body with a 1MB limit
// to prevent vulnerability to buffer attacks.
//
parser_.emplace(1024 * 1024);
parser_.emplace(std::piecewise_construct, std::make_tuple(1024 * 1024));
// Read just the header
beast::http::async_read_header(
+2 -1
View File
@@ -188,7 +188,8 @@ private:
// We construct the dynamic body with a 1MB limit
// to prevent vulnerability to buffer attacks.
//
beast::http::request_parser<beast::http::dynamic_body> parser(1024* 1024);
beast::http::request_parser<beast::http::dynamic_body> parser(
std::piecewise_construct, std::make_tuple(1024* 1024));
// Read the header first
beast::http::read_header(impl().stream(), buffer_, parser, ec);