Also adds an assert to copy to ensure that bufferlist iterator copy
completes.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
while (len > 0) {
if (p == ls->end())
throw end_of_buffer();
+ assert(p->length() > 0);
unsigned howmuch = p->length() - p_off;
if (len < howmuch) howmuch = len;
last_p = begin();
}
void push_front(ptr& bp) {
+ if (bp.length() == 0) return;
_buffers.push_front(bp);
_len += bp.length();
}
void push_front(raw *r) {
ptr bp(r);
- _buffers.push_front(bp);
- _len += bp.length();
+ push_front(bp);
}
void push_back(const ptr& bp) {
+ if (bp.length() == 0) return;
_buffers.push_back(bp);
_len += bp.length();
}
void push_back(raw *r) {
ptr bp(r);
- _buffers.push_back(bp);
- _len += bp.length();
+ push_back(bp);
}
void zero() {
for (std::list<ptr>::iterator it = _buffers.begin();