forked from boostorg/beast
Fix read_size_helper usage:
read_size_helper can return zero if the buffer reaches its maximum size, causing infinite loops in HTTP. The function maybe_read_size_helper is provided to throw an exception instead of returning a value for this case.
This commit is contained in:
@@ -143,16 +143,11 @@ public:
|
||||
BEAST_EXPECT(b.size() == 1);
|
||||
}
|
||||
{
|
||||
flat_buffer b{10};
|
||||
try
|
||||
{
|
||||
b.reserve(11);
|
||||
fail("", __FILE__, __LINE__);
|
||||
}
|
||||
catch(std::length_error const&)
|
||||
{
|
||||
pass();
|
||||
}
|
||||
flat_buffer b{20};
|
||||
ostream(b) << "12345";
|
||||
b.consume(3);
|
||||
ostream(b) << "67890123";
|
||||
BEAST_EXPECT(to_string(b.data()) == "4567890123");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user