forked from boostorg/beast
Remove BodyReader::is_deferred (API Change):
The is_deferred nested type is removed from the BodyReader requirements. Performance for sending messages with `file_body` was cut almost in half with is_deferred as `std::true_type` since it caused double the number of socket writes. If the deferred behavior is absolutely necessary, callers can get the same effect by manually sending the headers first. Actions Required: * Callers who need the behavior of is_deferred as `std::true_type` should manually construct a serializer and serialize the header first, followed by the body.
This commit is contained in:
1 parent
bf59634bc2
commit
edeb44617b
12 files changed
+24
-86
No files matched your search
@@ -48,14 +48,6 @@ struct Body_BodyReader {
|
||||
struct BodyReader
|
||||
{
|
||||
public:
|
||||
/** Controls when the implementation requests buffers.
|
||||
|
||||
If false, the implementation will request the first buffer
|
||||
immediately and try to serialize both the header and some
|
||||
or all of the body in a single buffer.
|
||||
*/
|
||||
using is_deferred = std::false_type;
|
||||
|
||||
/// The type of buffer returned by `get`.
|
||||
using const_buffers_type = boost::asio::const_buffers_1;
|
||||
|
||||
|
||||
+4
-16
@@ -42,8 +42,6 @@ public:
|
||||
value_type const& body_;
|
||||
|
||||
public:
|
||||
using is_deferred = std::false_type;
|
||||
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffers_1;
|
||||
|
||||
@@ -67,7 +65,6 @@ public:
|
||||
};
|
||||
|
||||
template<
|
||||
bool isDeferred,
|
||||
bool isSplit,
|
||||
bool isFinalEmpty
|
||||
>
|
||||
@@ -85,9 +82,6 @@ public:
|
||||
value_type const& body_;
|
||||
|
||||
public:
|
||||
using is_deferred =
|
||||
std::integral_constant<bool, isDeferred>;
|
||||
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffers_1;
|
||||
|
||||
@@ -220,8 +214,6 @@ public:
|
||||
value_type const& body_;
|
||||
|
||||
public:
|
||||
using is_deferred = std::false_type;
|
||||
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffers_1;
|
||||
|
||||
@@ -844,14 +836,10 @@ public:
|
||||
yield_to(
|
||||
[&](yield_context yield)
|
||||
{
|
||||
testWriteStream<test_body<false, false, false>>(yield);
|
||||
testWriteStream<test_body<false, false, true>>(yield);
|
||||
testWriteStream<test_body<false, true, false>>(yield);
|
||||
testWriteStream<test_body<false, true, true>>(yield);
|
||||
testWriteStream<test_body< true, false, false>>(yield);
|
||||
testWriteStream<test_body< true, false, true>>(yield);
|
||||
testWriteStream<test_body< true, true, false>>(yield);
|
||||
testWriteStream<test_body< true, true, true>>(yield);
|
||||
testWriteStream<test_body<false, false>>(yield);
|
||||
testWriteStream<test_body<false, true>>(yield);
|
||||
testWriteStream<test_body< true, false>>(yield);
|
||||
testWriteStream<test_body< true, true>>(yield);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user