- no default arg
- account for extra padding
- adjust test to target 512 bytes, which sounds reasonable?
Signed-off-by: Sage Weil <sage@newdream.net>
bufferlist t;
while (true) {
_encode_r(t);
- if (t.length() <= max) {
+ // account for the additional overhead in _encode_final
+ if (t.length() + 8 <= max) {
break;
}
// downgrade resolution
void _encode_r(bufferlist& bl) const;
void _encode_final(bufferlist& bl, bufferlist& t) const;
- void dynamic_encode(ceph::buffer::list& bl, size_t max = 1024);
+ void dynamic_encode(ceph::buffer::list& bl, size_t max);
void encode(ceph::buffer::list& bl) const;
void decode(ceph::buffer::list::const_iterator& p);
ASSERT_TRUE(ret);
if (count_bits(i) <= 2) {
bufferlist bl;
- r.dynamic_encode(bl, 1024);
+ r.dynamic_encode(bl, 512);
if (count_bits(i) == 1) {
cout << i << "\t" << bl.length()
<< "\t" << r.describe_encoding()