forked from boostorg/beast
Tidying and fix warnings
This commit is contained in:
@@ -20,7 +20,7 @@ else()
|
|||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS
|
set(CMAKE_CXX_FLAGS
|
||||||
"${CMAKE_CXX_FLAGS} -g -std=c++11 -Wall -Wextra -Wpedantic -Wconversion -Wno-unused-variable")
|
"${CMAKE_CXX_FLAGS} -g -std=c++11 -Wall -Wpedantic")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message ("cxx Flags: " ${CMAKE_CXX_FLAGS})
|
message ("cxx Flags: " ${CMAKE_CXX_FLAGS})
|
||||||
|
@@ -35,7 +35,7 @@ private:
|
|||||||
std::thread thread_;
|
std::thread thread_;
|
||||||
std::mutex m_;
|
std::mutex m_;
|
||||||
std::condition_variable cv_;
|
std::condition_variable cv_;
|
||||||
bool running_ = false;;
|
bool running_ = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// The type of yield context passed to functions.
|
/// The type of yield context passed to functions.
|
||||||
@@ -70,7 +70,7 @@ public:
|
|||||||
This call will block until the coroutine terminates.
|
This call will block until the coroutine terminates.
|
||||||
|
|
||||||
Function will be called with this signature:
|
Function will be called with this signature:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
void f(yield_context);
|
void f(yield_context);
|
||||||
@endcode
|
@endcode
|
||||||
|
@@ -543,7 +543,7 @@ suite::run (runner& r)
|
|||||||
#define BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,manual) \
|
#define BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,manual) \
|
||||||
static beast::unit_test::detail::insert_suite <Class##_test> \
|
static beast::unit_test::detail::insert_suite <Class##_test> \
|
||||||
Library ## Module ## Class ## _test_instance ( \
|
Library ## Module ## Class ## _test_instance ( \
|
||||||
#Class, #Module, #Library, manual);
|
#Class, #Module, #Library, manual)
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -146,7 +146,7 @@ unhex(char c)
|
|||||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // 112
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // 112
|
||||||
}};
|
}};
|
||||||
return tab[static_cast<std::uint8_t>(c)];
|
return tab[static_cast<std::uint8_t>(c)];
|
||||||
};
|
}
|
||||||
|
|
||||||
template<class = void>
|
template<class = void>
|
||||||
struct parser_str_t
|
struct parser_str_t
|
||||||
|
@@ -478,10 +478,9 @@ write(SyncWriteStream& stream,
|
|||||||
cv.notify_one();
|
cv.notify_one();
|
||||||
}};
|
}};
|
||||||
auto copy = resume;
|
auto copy = resume;
|
||||||
boost::tribool result;
|
boost::tribool result = wp.w(std::move(copy),
|
||||||
result = wp.w(std::move(copy), ec,
|
ec, detail::writef0_lambda<SyncWriteStream,
|
||||||
detail::writef0_lambda<SyncWriteStream, decltype(wp.sb)>{
|
decltype(wp.sb)>{stream, wp.sb, wp.chunked, ec});
|
||||||
stream, wp.sb, wp.chunked, ec});
|
|
||||||
if(ec)
|
if(ec)
|
||||||
return;
|
return;
|
||||||
if(boost::indeterminate(result))
|
if(boost::indeterminate(result))
|
||||||
|
@@ -93,7 +93,6 @@ struct message
|
|||||||
@param v An argument forwarded to the headers constructor.
|
@param v An argument forwarded to the headers constructor.
|
||||||
*/
|
*/
|
||||||
template<class U, class V>
|
template<class U, class V>
|
||||||
explicit
|
|
||||||
message(U&& u, V&& v)
|
message(U&& u, V&& v)
|
||||||
: headers(std::forward<V>(v))
|
: headers(std::forward<V>(v))
|
||||||
, body(std::forward<U>(u))
|
, body(std::forward<U>(u))
|
||||||
@@ -118,7 +117,6 @@ struct message
|
|||||||
@param vn A tuple forwarded as a parameter pack to the headers constructor.
|
@param vn A tuple forwarded as a parameter pack to the headers constructor.
|
||||||
*/
|
*/
|
||||||
template<class... Un, class... Vn>
|
template<class... Un, class... Vn>
|
||||||
explicit
|
|
||||||
message(std::piecewise_construct_t,
|
message(std::piecewise_construct_t,
|
||||||
std::tuple<Un...>&& un, std::tuple<Vn...>&& vn)
|
std::tuple<Un...>&& un, std::tuple<Vn...>&& vn)
|
||||||
: message(std::piecewise_construct, un, vn,
|
: message(std::piecewise_construct, un, vn,
|
||||||
|
@@ -48,9 +48,9 @@ little_uint32_to_native(void const* buf)
|
|||||||
std::uint8_t const*>(buf);
|
std::uint8_t const*>(buf);
|
||||||
return
|
return
|
||||||
p[0] +
|
p[0] +
|
||||||
(static_cast<std::uint64_t>(p[1])<< 8) +
|
(static_cast<std::uint32_t>(p[1])<< 8) +
|
||||||
(static_cast<std::uint64_t>(p[2])<<16) +
|
(static_cast<std::uint32_t>(p[2])<<16) +
|
||||||
(static_cast<std::uint64_t>(p[3])<<24);
|
(static_cast<std::uint32_t>(p[3])<<24);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
|
@@ -474,14 +474,14 @@ public:
|
|||||||
[](null_parser<true> const&)
|
[](null_parser<true> const&)
|
||||||
{
|
{
|
||||||
});
|
});
|
||||||
|
|
||||||
parse_ev<true>(
|
parse_ev<true>(
|
||||||
"GET / HTTP/1.0\r\n"
|
"GET / HTTP/1.0\r\n"
|
||||||
"Content-Length: 1\r\n"
|
"Content-Length: 1\r\n"
|
||||||
"Content-Length: 2\r\n"
|
"Content-Length: 2\r\n"
|
||||||
"\r\n",
|
"\r\n",
|
||||||
parse_error::bad_content_length);
|
parse_error::bad_content_length);
|
||||||
|
|
||||||
parse_ev<true>(
|
parse_ev<true>(
|
||||||
"GET / HTTP/1.0\r\n"
|
"GET / HTTP/1.0\r\n"
|
||||||
"Transfer-Encoding: chunked\r\n"
|
"Transfer-Encoding: chunked\r\n"
|
||||||
@@ -489,7 +489,7 @@ public:
|
|||||||
"fffffffffffffffff\r\n"
|
"fffffffffffffffff\r\n"
|
||||||
"0\r\n\r\n",
|
"0\r\n\r\n",
|
||||||
parse_error::bad_content_length);
|
parse_error::bad_content_length);
|
||||||
|
|
||||||
parse_ev<true>("GET / HTTP/1.0\r\nContent-Length: 1e9\r\n\r\n",
|
parse_ev<true>("GET / HTTP/1.0\r\nContent-Length: 1e9\r\n\r\n",
|
||||||
parse_error::bad_content_length);
|
parse_error::bad_content_length);
|
||||||
|
|
||||||
@@ -533,9 +533,8 @@ public:
|
|||||||
{
|
{
|
||||||
using boost::asio::buffer;
|
using boost::asio::buffer;
|
||||||
std::string s;
|
std::string s;
|
||||||
std::size_t n;
|
|
||||||
|
|
||||||
for(n = 0;; ++n)
|
for(std::size_t n = 0;; ++n)
|
||||||
{
|
{
|
||||||
// Create a request and set one octet to an invalid char
|
// Create a request and set one octet to an invalid char
|
||||||
s =
|
s =
|
||||||
@@ -572,7 +571,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(n = 0;; ++n)
|
for(std::size_t n = 0;; ++n)
|
||||||
{
|
{
|
||||||
// Create a response and set one octet to an invalid char
|
// Create a response and set one octet to an invalid char
|
||||||
s =
|
s =
|
||||||
|
@@ -72,19 +72,19 @@ public:
|
|||||||
{
|
{
|
||||||
static_assert(std::is_constructible<
|
static_assert(std::is_constructible<
|
||||||
message<true, default_body, headers>>::value, "");
|
message<true, default_body, headers>>::value, "");
|
||||||
|
|
||||||
static_assert(std::is_constructible<
|
static_assert(std::is_constructible<
|
||||||
message<true, one_arg_body, headers>, Arg1>::value, "");
|
message<true, one_arg_body, headers>, Arg1>::value, "");
|
||||||
|
|
||||||
static_assert(std::is_constructible<
|
static_assert(std::is_constructible<
|
||||||
message<true, one_arg_body, headers>, Arg1 const>::value, "");
|
message<true, one_arg_body, headers>, Arg1 const>::value, "");
|
||||||
|
|
||||||
static_assert(std::is_constructible<
|
static_assert(std::is_constructible<
|
||||||
message<true, one_arg_body, headers>, Arg1 const&>::value, "");
|
message<true, one_arg_body, headers>, Arg1 const&>::value, "");
|
||||||
|
|
||||||
static_assert(std::is_constructible<
|
static_assert(std::is_constructible<
|
||||||
message<true, one_arg_body, headers>, Arg1&&>::value, "");
|
message<true, one_arg_body, headers>, Arg1&&>::value, "");
|
||||||
|
|
||||||
static_assert(! std::is_constructible<
|
static_assert(! std::is_constructible<
|
||||||
message<true, one_arg_body, headers>>::value, "");
|
message<true, one_arg_body, headers>>::value, "");
|
||||||
|
|
||||||
|
@@ -42,53 +42,53 @@ public:
|
|||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_method(boost::string_ref const&, error_code& ec)
|
void on_method(boost::string_ref const&, error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_uri(boost::string_ref const&, error_code& ec)
|
void on_uri(boost::string_ref const&, error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_reason(boost::string_ref const&, error_code& ec)
|
void on_reason(boost::string_ref const&, error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_request(error_code& ec)
|
void on_request(error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_response(error_code& ec)
|
void on_response(error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_field(boost::string_ref const&, error_code& ec)
|
void on_field(boost::string_ref const&, error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_value(boost::string_ref const&, error_code& ec)
|
void on_value(boost::string_ref const&, error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
int on_headers(error_code& ec)
|
int on_headers(error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_body(boost::string_ref const&, error_code& ec)
|
void on_body(boost::string_ref const&, error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_complete(error_code& ec)
|
void on_complete(error_code& ec)
|
||||||
{
|
{
|
||||||
fc_.fail(ec);
|
fc_.fail(ec);
|
||||||
|
@@ -34,7 +34,7 @@ public:
|
|||||||
class string_write_stream
|
class string_write_stream
|
||||||
{
|
{
|
||||||
boost::asio::io_service& ios_;
|
boost::asio::io_service& ios_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::string str;
|
std::string str;
|
||||||
|
|
||||||
|
@@ -181,7 +181,7 @@ public:
|
|||||||
check(fh);
|
check(fh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bad(std::initializer_list<std::uint8_t> bs)
|
void bad(std::initializer_list<std::uint8_t> bs)
|
||||||
{
|
{
|
||||||
using boost::asio::buffer;
|
using boost::asio::buffer;
|
||||||
|
@@ -481,7 +481,6 @@ public:
|
|||||||
{
|
{
|
||||||
stream<socket_type> ws;
|
stream<socket_type> ws;
|
||||||
|
|
||||||
explicit
|
|
||||||
con(endpoint_type const& ep, boost::asio::io_service& ios)
|
con(endpoint_type const& ep, boost::asio::io_service& ios)
|
||||||
: ws(ios)
|
: ws(ios)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user