mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
Fix buffers_adapter max_size
This commit is contained in:
@ -2,6 +2,7 @@ Version 173:
|
||||
|
||||
* Remove Autobahn testsuite doc note
|
||||
* Fix buffers_adapter iterator value type
|
||||
* Fix buffers_adapter max_size
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -447,20 +447,17 @@ buffers_adapter<MutableBufferSequence>::commit(std::size_t n)
|
||||
{
|
||||
out_pos_ += n;
|
||||
in_size_ += n;
|
||||
max_size_ -= n;
|
||||
return;
|
||||
}
|
||||
++out_;
|
||||
n -= avail;
|
||||
out_pos_ = 0;
|
||||
in_size_ += avail;
|
||||
max_size_ -= avail;
|
||||
}
|
||||
|
||||
n = (std::min)(n, out_end_ - out_pos_);
|
||||
out_pos_ += n;
|
||||
in_size_ += n;
|
||||
max_size_ -= n;
|
||||
if(out_pos_ == buffer_size(*out_))
|
||||
{
|
||||
++out_;
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
ba.commit(buffer_copy(d, buffer(s.data(), x)));
|
||||
}
|
||||
BEAST_EXPECT(ba.size() == x);
|
||||
BEAST_EXPECT(ba.max_size() == sizeof(buf) - x);
|
||||
BEAST_EXPECT(ba.max_size() == sizeof(buf));
|
||||
BEAST_EXPECT(buffer_size(ba.data()) == ba.size());
|
||||
{
|
||||
auto d = ba.prepare(x);
|
||||
@ -89,7 +89,7 @@ public:
|
||||
}
|
||||
ba.commit(1);
|
||||
BEAST_EXPECT(ba.size() == x + y);
|
||||
BEAST_EXPECT(ba.max_size() == sizeof(buf) - (x + y));
|
||||
BEAST_EXPECT(ba.max_size() == sizeof(buf));
|
||||
BEAST_EXPECT(buffer_size(ba.data()) == ba.size());
|
||||
{
|
||||
auto d = ba.prepare(x);
|
||||
@ -109,7 +109,6 @@ public:
|
||||
}
|
||||
ba.commit(2);
|
||||
BEAST_EXPECT(ba.size() == x + y + z);
|
||||
BEAST_EXPECT(ba.max_size() == 0);
|
||||
BEAST_EXPECT(buffer_size(ba.data()) == ba.size());
|
||||
BEAST_EXPECT(buffers_to_string(ba.data()) == s);
|
||||
ba.consume(t);
|
||||
|
Reference in New Issue
Block a user