Fix compile errors under Clang 3.4

fixes #2030
closes #2031
This commit is contained in:
Richard Hodges
2020-07-22 13:07:42 +02:00
parent 4f913cab63
commit 2efb729c53
3 changed files with 7 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
* Fix compile errors under Clang 3.4
* Fix portability bug in websocket server sync example.
--------------------------------------------------------------------------------

View File

@@ -355,8 +355,8 @@ int main(int argc, char** argv)
}
namespace net = boost::asio;
auto const address{net::ip::make_address(argv[1])};
auto const port{static_cast<unsigned short>(std::atoi(argv[2]))};
auto const address = net::ip::make_address(argv[1]);
auto const port = static_cast<unsigned short>(std::atoi(argv[2]));
using endpoint_type = net::ip::tcp::endpoint;
@@ -364,7 +364,7 @@ int main(int argc, char** argv)
// the echo, and then shut everything down and exit.
net::io_context ioc;
net::ip::tcp::acceptor acceptor{ioc};
endpoint_type ep{address, port};
endpoint_type ep(address, port);
acceptor.open(ep.protocol());
acceptor.set_option(net::socket_base::reuse_address(true));
acceptor.bind(ep);

View File

@@ -71,7 +71,8 @@ class basic_parser
{
boost::optional<std::uint64_t>
body_limit_ =
default_body_limit(is_request{}); // max payload body
boost::optional<std::uint64_t>(
default_body_limit(is_request{})); // max payload body
std::uint64_t len_ = 0; // size of chunk or body
std::uint64_t len0_ = 0; // content length if known
std::unique_ptr<char[]> buf_; // temp storage