// << " (p_off " << p_off << " in " << p->length() << ")"
// << std::endl;
- p_off += o;
-
- if (!o) {
- return;
- }
- while (p_off > 0) {
- if (p == ls->end())
- throw end_of_buffer();
+ p_off +=o;
+ while (p != ls->end()) {
if (p_off >= p->length()) {
// skip this buffer
p_off -= p->length();
break;
}
}
+ if (p == ls->end() && p_off) {
+ throw end_of_buffer();
+ }
off += o;
}
while (len > 0) {
if (p == ls->end())
throw end_of_buffer();
- ceph_assert(p->length() > 0);
unsigned howmuch = p->length() - p_off;
if (len < howmuch) howmuch = len;
}
if (p == ls->end())
throw end_of_buffer();
- ceph_assert(p->length() > 0);
dest = create(len);
copy(len, dest.c_str());
}
}
if (p == ls->end())
throw end_of_buffer();
- ceph_assert(p->length() > 0);
unsigned howmuch = p->length() - p_off;
if (howmuch < len) {
dest = create(len);
while (1) {
if (p == ls->end())
return;
- ceph_assert(p->length() > 0);
unsigned howmuch = p->length() - p_off;
const char *c_str = p->c_str();
++b;
}
}
- ceph_assert(b == std::cend(other._buffers));
return true;
}