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-03 20:33:54 -07:00
parent 2ee088de5f
commit b0e52dd246
11 changed files with 487 additions and 210 deletions

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);