forked from boostorg/beast
Remove deprecated Body reader and writer ctor signatures
This commit is contained in:
@@ -36,42 +36,6 @@ public:
|
||||
using parser_type =
|
||||
parser<isRequest, string_body>;
|
||||
|
||||
struct deprecated_body
|
||||
{
|
||||
using value_type = std::string;
|
||||
|
||||
class reader
|
||||
{
|
||||
public:
|
||||
template<bool isRequest, class Fields>
|
||||
explicit
|
||||
reader(message<isRequest, deprecated_body, Fields>&)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
init(boost::optional<std::uint64_t> const&, error_code& ec)
|
||||
{
|
||||
ec = {};
|
||||
}
|
||||
|
||||
template<class ConstBufferSequence>
|
||||
std::size_t
|
||||
put(ConstBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
ec = {};
|
||||
return boost::asio::buffer_size(buffers);
|
||||
}
|
||||
|
||||
void
|
||||
finish(error_code& ec)
|
||||
{
|
||||
ec = {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
static
|
||||
boost::asio::const_buffer
|
||||
buf(string_view s)
|
||||
@@ -379,12 +343,6 @@ public:
|
||||
BEAST_EXPECT(std::distance(m1.begin(), m1.end()) == 0);
|
||||
}
|
||||
|
||||
void testBodyReaderCtor()
|
||||
{
|
||||
request_parser<deprecated_body> p;
|
||||
boost::ignore_unused(p);
|
||||
}
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
@@ -393,7 +351,6 @@ public:
|
||||
testNeedMore<multi_buffer>();
|
||||
testGotSome();
|
||||
testIssue818();
|
||||
testBodyReaderCtor();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -20,40 +20,6 @@ namespace http {
|
||||
class serializer_test : public beast::unit_test::suite
|
||||
{
|
||||
public:
|
||||
struct deprecated_body
|
||||
{
|
||||
using value_type = std::string;
|
||||
|
||||
class writer
|
||||
{
|
||||
public:
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffer;
|
||||
|
||||
value_type const& body_;
|
||||
|
||||
template<bool isRequest, class Fields>
|
||||
explicit
|
||||
writer(message<isRequest, deprecated_body, Fields> const& m):
|
||||
body_{m.body()}
|
||||
{
|
||||
}
|
||||
|
||||
void init(error_code& ec)
|
||||
{
|
||||
ec.assign(0, ec.category());
|
||||
}
|
||||
|
||||
boost::optional<std::pair<const_buffers_type, bool>>
|
||||
get(error_code& ec)
|
||||
{
|
||||
ec.assign(0, ec.category());
|
||||
return {{const_buffers_type{
|
||||
body_.data(), body_.size()}, false}};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
struct const_body
|
||||
{
|
||||
struct value_type{};
|
||||
@@ -149,20 +115,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void testBodyWriterCtor()
|
||||
{
|
||||
response<deprecated_body> res;
|
||||
request<deprecated_body> req;
|
||||
serializer<false, deprecated_body> sr1{res};
|
||||
serializer<true, deprecated_body> sr2{req};
|
||||
boost::ignore_unused(sr1, sr2);
|
||||
}
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
testWriteLimit();
|
||||
testBodyWriterCtor();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user