forked from boostorg/beast
1 parent
e76281867d
commit
bf0145da67
31 files changed
+174
-156
No files matched your search
@@ -21,6 +21,7 @@
|
||||
#include <boost/asio/handler_continuation_hook.hpp>
|
||||
#include <boost/asio/handler_invoke_hook.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -316,7 +317,7 @@ accept()
|
||||
error_code ec;
|
||||
accept(ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -333,7 +334,7 @@ accept_ex(ResponseDecorator const& decorator)
|
||||
error_code ec;
|
||||
accept_ex(decorator, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -376,7 +377,7 @@ accept(ConstBufferSequence const& buffers)
|
||||
error_code ec;
|
||||
accept(buffers, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -398,7 +399,7 @@ accept_ex(ConstBufferSequence const& buffers,
|
||||
error_code ec;
|
||||
accept_ex(buffers, decorator, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -457,7 +458,7 @@ accept(http::header<true, Fields> const& req)
|
||||
error_code ec;
|
||||
accept(req, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -475,7 +476,7 @@ accept_ex(http::header<true, Fields> const& req,
|
||||
error_code ec;
|
||||
accept_ex(req, decorator, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -522,7 +523,7 @@ accept(http::header<true, Fields> const& req,
|
||||
error_code ec;
|
||||
accept(req, buffers, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -545,7 +546,7 @@ accept_ex(http::header<true, Fields> const& req,
|
||||
error_code ec;
|
||||
accept_ex(req, buffers, decorator, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <boost/asio/handler_alloc_hook.hpp>
|
||||
#include <boost/asio/handler_continuation_hook.hpp>
|
||||
#include <boost/asio/handler_invoke_hook.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
@@ -227,7 +228,7 @@ close(close_reason const& cr)
|
||||
error_code ec;
|
||||
close(cr, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <boost/asio/handler_continuation_hook.hpp>
|
||||
#include <boost/asio/handler_invoke_hook.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
@@ -265,7 +266,7 @@ handshake(string_view const& host,
|
||||
handshake(
|
||||
host, target, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -280,7 +281,7 @@ handshake(response_type& res,
|
||||
error_code ec;
|
||||
handshake(res, host, target, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -299,7 +300,7 @@ handshake_ex(string_view const& host,
|
||||
error_code ec;
|
||||
handshake_ex(host, target, decorator, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -319,7 +320,7 @@ handshake_ex(response_type& res,
|
||||
error_code ec;
|
||||
handshake_ex(res, host, target, decorator, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <boost/asio/handler_alloc_hook.hpp>
|
||||
#include <boost/asio/handler_continuation_hook.hpp>
|
||||
#include <boost/asio/handler_invoke_hook.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
@@ -240,7 +241,7 @@ ping(ping_data const& payload)
|
||||
error_code ec;
|
||||
ping(payload, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -262,7 +263,7 @@ pong(ping_data const& payload)
|
||||
error_code ec;
|
||||
pong(payload, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <boost/asio/handler_invoke_hook.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
|
||||
@@ -721,7 +722,7 @@ read_frame(frame_info& fi, DynamicBuffer& buffer)
|
||||
error_code ec;
|
||||
read_frame(fi, buffer, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -1136,7 +1137,7 @@ read(opcode& op, DynamicBuffer& buffer)
|
||||
error_code ec;
|
||||
read(op, buffer, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <beast/core/detail/type_traits.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/endian/buffers.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
@@ -48,20 +49,20 @@ set_option(permessage_deflate const& o)
|
||||
{
|
||||
if( o.server_max_window_bits > 15 ||
|
||||
o.server_max_window_bits < 9)
|
||||
throw std::invalid_argument{
|
||||
"invalid server_max_window_bits"};
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
||||
"invalid server_max_window_bits"});
|
||||
if( o.client_max_window_bits > 15 ||
|
||||
o.client_max_window_bits < 9)
|
||||
throw std::invalid_argument{
|
||||
"invalid client_max_window_bits"};
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
||||
"invalid client_max_window_bits"});
|
||||
if( o.compLevel < 0 ||
|
||||
o.compLevel > 9)
|
||||
throw std::invalid_argument{
|
||||
"invalid compLevel"};
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
||||
"invalid compLevel"});
|
||||
if( o.memLevel < 1 ||
|
||||
o.memLevel > 9)
|
||||
throw std::invalid_argument{
|
||||
"invalid memLevel"};
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
||||
"invalid memLevel"});
|
||||
pmd_opts_ = o;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <boost/asio/handler_continuation_hook.hpp>
|
||||
#include <boost/asio/handler_invoke_hook.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
@@ -580,7 +581,7 @@ write_frame(bool fin, ConstBufferSequence const& buffers)
|
||||
error_code ec;
|
||||
write_frame(fin, buffers, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -932,7 +933,7 @@ write(ConstBufferSequence const& buffers)
|
||||
error_code ec;
|
||||
write(buffers, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <beast/config.hpp>
|
||||
#include <beast/websocket/rfc6455.hpp>
|
||||
#include <beast/core/detail/type_traits.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
@@ -90,8 +91,8 @@ struct message_type
|
||||
message_type(opcode op)
|
||||
{
|
||||
if(op != opcode::binary && op != opcode::text)
|
||||
throw beast::detail::make_exception<std::invalid_argument>(
|
||||
"bad opcode", __FILE__, __LINE__);
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
||||
"bad opcode"});
|
||||
value = op;
|
||||
}
|
||||
};
|
||||
@@ -234,8 +235,8 @@ struct read_buffer_size
|
||||
: value(n)
|
||||
{
|
||||
if(n < 8)
|
||||
throw beast::detail::make_exception<std::invalid_argument>(
|
||||
"read buffer size is too small", __FILE__, __LINE__);
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
||||
"read buffer size is too small"});
|
||||
}
|
||||
};
|
||||
#endif
|
||||
@@ -315,8 +316,8 @@ struct write_buffer_size
|
||||
: value(n)
|
||||
{
|
||||
if(n < 8)
|
||||
throw beast::detail::make_exception<std::invalid_argument>(
|
||||
"write buffer size is too small", __FILE__, __LINE__);
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
||||
"write buffer size is too small"});
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user